From e71c3623094ce67c25270ab3959103cce484cfad Mon Sep 17 00:00:00 2001 From: charitha Date: Sun, 14 Apr 2019 15:58:51 +0530 Subject: [PATCH 01/27] Add device type specific platform config endpoint --- .../api/DeviceTypeManagementService.java | 239 +++++++++++------- .../DeviceTypeManagementAdminService.java | 164 +++++++++++- .../impl/DeviceTypeManagementServiceImpl.java | 117 +++++---- .../DeviceTypeManagementAdminServiceImpl.java | 75 +++++- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 2 +- .../devicemgt/app/conf/config.json | 3 + .../modules/business-controllers/device.js | 2 +- .../app/pages/cdmf.page.devices/devices.js | 10 +- .../cdmf.unit.device.types.listing/listing.js | 4 +- .../units/cdmf.unit.policy.create/create.js | 2 +- .../cdmf.unit.ui.navbar.nav-menu/nav-menu.js | 13 +- 11 files changed, 452 insertions(+), 179 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java index 390bb2dca46..db10142cc4c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java @@ -15,6 +15,22 @@ * specific language governing permissions and limitations * under the License. * + * + * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.jaxrs.service.api; @@ -31,15 +47,23 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ResponseHeader; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; +import org.wso2.carbon.device.mgt.common.Feature; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceTypeList; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.util.Constants; import javax.validation.constraints.Size; -import javax.ws.rs.*; +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.core.MediaType; import javax.ws.rs.core.Response; +import java.util.List; @SwaggerDefinition( info = @Info( @@ -62,13 +86,19 @@ import javax.ws.rs.core.Response; name = "Getting the Supported Device Platforms", description = "Getting the Supported Device Platforms", key = "perm:device-types:types", - permissions = {"/device-mgt/devices/owning-device/view"} + permissions = {"/device-mgt/device-type/view"} ), @Scope( name = "Get Feature Details of a Device Type", description = "Get Feature Details of a Device Type", key = "perm:device-types:features", - permissions = {"/device-mgt/devices/owning-device/view"} + permissions = {"/device-mgt/device-type/features/view"} + ), + @Scope( + name = "Get Config Details of a Device Type", + description = "Get Config Details of a Device Type", + key = "perm:device-types:configs", + permissions = {"/device-mgt/device-type/config/view"} ) } ) @@ -84,7 +114,7 @@ public interface DeviceTypeManagementService { produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Getting the Supported Device Platforms", - notes = "Get the list of device platforms supported by WSO2 EMM.", + notes = "Get the list of device platforms supported by Entgra IoTS.", tags = "Device Type Management", extensions = { @Extension(properties = { @@ -133,18 +163,71 @@ public interface DeviceTypeManagementService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200" + ) @HeaderParam("If-Modified-Since") String ifModifiedSince); + @GET + @Path("/{type}") + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Getting Details of a Device Type", + notes = "Get the details of a device by searching via the device type and the tenant domain.", + response = DeviceType.class, + tags = "Device Type Management", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:types") + }) + } + ) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK. \n Successfully fetched the device type.", + response = DeviceType.class, + responseContainer = "List", + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body") + }), + @ApiResponse( + code = 304, + message = "Not Modified. Empty body because the client already has the latest version of the " + + "requested resource.\n"), + @ApiResponse( + code = 401, + message = "Unauthorized.\n The unauthorized access to the requested resource.", + response = ErrorResponse.class), + @ApiResponse( + code = 404, + message = "Not Found.\n The specified device does not exist", + response = ErrorResponse.class), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported"), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching the device list.", + response = ErrorResponse.class) + }) + Response getDeviceTypeByName( + @ApiParam( + name = "type", + value = "The device type name, such as ios, android, windows or fire-alarm.", + required = true) + @PathParam("type") + @Size(min = 2, max = 45) + String type); + @GET @Path("/{type}/features") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", value = "Get Feature Details of a Device Type", - notes = "The features in WSO2 EMM enables you to carry out many operations on a given device platform. " + + notes = "The features in Entgra IoTS enables you to carry out many operations on a given device platform. " + "Using this REST API you can get the features that can be carried out on a preferred device type," + " such as iOS, Android or Windows.", tags = "Device Type Management", @@ -202,108 +285,78 @@ public interface DeviceTypeManagementService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200" + ) @HeaderParam("If-Modified-Since") String ifModifiedSince); @GET - @Path("/all/{type}") + @Path("/{type}/configs") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", - value = "Getting Details of a Device Type", - notes = "Get the details of a device by searching via the device type and the tenant domain.", - response = DeviceType.class, - tags = "Device Type Management Administrative Service", + value = "Get Configuration Details of a Device Type", + notes = "The features in Entgra IoTS enables you to carry out many operations on a given device platform. " + + "Using this REST API you can get platform configurations that can be carried out on a preferred " + + "device type, such as iOS, Android or Windows.", + tags = "Device Type Management", extensions = { @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:types") + @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:configs") }) } ) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK. \n Successfully fetched the device type.", - response = DeviceType.class, - responseContainer = "List", - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body") - }), - @ApiResponse( - code = 304, - message = "Not Modified. Empty body because the client already has the latest version of the " + - "requested resource.\n"), - @ApiResponse( - code = 401, - message = "Unauthorized.\n The unauthorized access to the requested resource.", - response = ErrorResponse.class), - @ApiResponse( - code = 404, - message = "Not Found.\n The specified device does not exist", - response = ErrorResponse.class), - @ApiResponse( - code = 406, - message = "Not Acceptable.\n The requested media type is not supported"), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Server error occurred while fetching the device list.", - response = ErrorResponse.class) - }) - Response getDeviceTypeByName( + @ApiResponses( + value = { + @ApiResponse( + code = 200, + message = "OK. \n Successfully fetched configurations.", + response = PlatformConfiguration.class, + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body"), + @ResponseHeader( + name = "ETag", + description = "Entity Tag of the response resource.\n" + + "Used by caches, or in conditional requests."), + @ResponseHeader( + name = "Last-Modified", + description = + "Date and time the resource was last modified.\n" + + "Used by caches, or in conditional requests."), + } + ), + @ApiResponse( + code = 304, + message = + "Not Modified. \n Empty body because the client already has the latest version " + + "of the requested resource.\n"), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported"), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching the " + + "list of supported device types.", + response = ErrorResponse.class) + } + ) + Response getConfigs( @ApiParam( name = "type", value = "The device type name, such as ios, android, windows or fire-alarm.", required = true) @PathParam("type") - @Size(min = 2, max = 45) - String type); - - @GET - @Path("/all") - @ApiOperation( - produces = MediaType.APPLICATION_JSON, - httpMethod = "GET", - value = "Retrieve device types information", - notes = "Retrieve device types information.", - response = DeviceType.class, - tags = "Device Type Management Administrative Service", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:types") - }) - } - ) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK. \n Successfully fetched the device type.", - response = DeviceType.class, - responseContainer = "List", - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body") - }), - @ApiResponse( - code = 304, - message = "Not Modified. Empty body because the client already has the latest version of the " + - "requested resource.\n"), - @ApiResponse( - code = 401, - message = "Unauthorized.\n The unauthorized access to the requested resource.", - response = ErrorResponse.class), - @ApiResponse( - code = 404, - message = "Not Found.\n The specified device does not exist", - response = ErrorResponse.class), - @ApiResponse( - code = 406, - message = "Not Acceptable.\n The requested media type is not supported"), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Server error occurred while fetching the device list.", - response = ErrorResponse.class) - }) - Response getDeviceTypes(); + @Size(max = 45) + String type, + @ApiParam( + name = "If-Modified-Since", + value = "Checks if the requested variant was modified, since the specified date-time.\n" + + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + + "Example: Mon, 05 Jan 2014 15:10:00 +0200" + ) + @HeaderParam("If-Modified-Since") + String ifModifiedSince); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java index aa90b5b3042..d669b2c3099 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java @@ -15,6 +15,23 @@ * specific language governing permissions and limitations * under the License. * + * + * Copyright (c) 2019, Entgra (pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * */ package org.wso2.carbon.device.mgt.jaxrs.service.api.admin; @@ -31,7 +48,7 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceTypeList; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; @@ -40,12 +57,11 @@ import org.wso2.carbon.device.mgt.jaxrs.util.Constants; 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.core.MediaType; import javax.ws.rs.core.Response; @@ -73,10 +89,22 @@ import javax.ws.rs.core.Response; @Scopes( scopes = { @Scope( - name = "Getting Details of a Device", - description = "Getting Details of a Device", + name = "Manage a Device Type", + description = "Add, Edit or View a Device Type", key = "perm:admin:device-type", permissions = {"/device-mgt/admin/device-type"} + ), + @Scope( + name = "Getting Details of a Device Type", + description = "Getting Details of a Device Type", + key = "perm:admin:device-type:view", + permissions = {"/device-mgt/admin/device-type/view"} + ), + @Scope( + name = "Add Device Type Config", + description = "Add Platform Config of a Device Type", + key = "perm:admin:device-type:configs", + permissions = {"/device-mgt/admin/device-type/config"} ) } ) @@ -88,10 +116,10 @@ public interface DeviceTypeManagementAdminService { httpMethod = "GET", value = "Getting the Supported Device Type with Meta Definition", notes = "Get the list of device types supported by WSO2 IoT.", - tags = "Device Type Management", + tags = "Device Type Management Administrative Service", extensions = { @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:admin:device-type") + @ExtensionProperty(name = Constants.SCOPE, value = "perm:admin:device-type:view") }) } ) @@ -133,6 +161,59 @@ public interface DeviceTypeManagementAdminService { ) Response getDeviceTypes(); + @GET + @Path("/{type}") + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Getting Details of a Device Type", + notes = "Get the details of a device by searching via the device type and the tenant domain.", + response = DeviceType.class, + tags = "Device Type Management Administrative Service", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:admin:device-type:view") + }) + } + ) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK. \n Successfully fetched the device type.", + response = DeviceType.class, + responseContainer = "List", + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body") + }), + @ApiResponse( + code = 304, + message = "Not Modified. Empty body because the client already has the latest version of the " + + "requested resource.\n"), + @ApiResponse( + code = 401, + message = "Unauthorized.\n The unauthorized access to the requested resource.", + response = ErrorResponse.class), + @ApiResponse( + code = 404, + message = "Not Found.\n The specified device does not exist", + response = ErrorResponse.class), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported"), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching the device list.", + response = ErrorResponse.class) + }) + Response getDeviceTypeByName( + @ApiParam( + name = "type", + value = "The device type name, such as ios, android, windows or fire-alarm.", + required = true) + @PathParam("type") + @Size(min = 2, max = 45) + String type); + @POST @ApiOperation( produces = MediaType.APPLICATION_JSON, @@ -179,6 +260,7 @@ public interface DeviceTypeManagementAdminService { required = true)DeviceType deviceType); @PUT + @Path("/{type}") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "PUT", @@ -219,9 +301,73 @@ public interface DeviceTypeManagementAdminService { message = "Internal Server Error. \n Server error occurred while fetching the device list.", response = ErrorResponse.class) }) - Response updateDeviceType(@ApiParam( - name = "type", + Response updateDeviceType( + @ApiParam( + name = "type", + value = "The device type name, such as ios, android, windows or fire-alarm.", + required = true) + @PathParam("type") + @Size(min = 2, max = 45) + String name, + @ApiParam( + name = "deviceType", value = "The device type such as ios, android, windows or fire-alarm.", required = true) DeviceType deviceType); + @POST + @Path("/{type}/configs") + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "POST", + value = "Add Configuration Details", + notes = "Add Configuration Details of a Device Type.", + tags = "Device Type Management Administrative Service", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:admin:device-type:configs") + }) + } + ) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK. \n Successfully added the device type config.", + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body") + }), + @ApiResponse( + code = 304, + message = "Not Modified. Empty body because the client already has the latest version of the " + + "requested resource.\n"), + @ApiResponse( + code = 401, + message = "Unauthorized.\n The unauthorized access to the requested resource.", + response = ErrorResponse.class), + @ApiResponse( + code = 404, + message = "Not Found.\n The specified device does not exist", + response = ErrorResponse.class), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported"), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching the device list.", + response = ErrorResponse.class) + }) + Response addDeviceTypePlatformConfig( + @ApiParam( + name = "type", + value = "The device type name, such as ios, android, windows or fire-alarm.", + required = true) + @PathParam("type") + @Size(min = 2, max = 45) + String type, + @ApiParam( + name = "config", + value = "Platform configuration of specified device type.", + required = true) + PlatformConfiguration config); + + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java index 5fdc06a5015..2c22f76e77d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java @@ -15,6 +15,23 @@ * specific language governing permissions and limitations * under the License. * + * + * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * */ package org.wso2.carbon.device.mgt.jaxrs.service.impl; @@ -23,14 +40,13 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; -import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceTypeList; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceTypeManagementService; -import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil; import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; import javax.validation.constraints.Size; @@ -38,7 +54,6 @@ 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.core.Response; import java.util.ArrayList; import java.util.List; @@ -51,50 +66,6 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ @GET @Override public Response getDeviceTypes(@HeaderParam("If-Modified-Since") String ifModifiedSince) { - List deviceTypes; - try { - deviceTypes = DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes(); - - DeviceTypeList deviceTypeList = new DeviceTypeList(); - deviceTypeList.setCount(deviceTypes.size()); - deviceTypeList.setList(deviceTypes); - return Response.status(Response.Status.OK).entity(deviceTypeList).build(); - } catch (DeviceManagementException e) { - String msg = "Error occurred while fetching the list of device types."; - log.error(msg, e); - return Response.serverError().entity( - new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); - } - } - - @GET - @Override - @Path("/{type}/features") - public Response getFeatures(@PathParam("type") @Size(max = 45) String type, @HeaderParam("If-Modified-Since") String ifModifiedSince) { - List features; - DeviceManagementProviderService dms; - try { - dms = DeviceMgtAPIUtils.getDeviceManagementService(); - FeatureManager fm = dms.getFeatureManager(type); - if (fm == null) { - return Response.status(Response.Status.NOT_FOUND).entity( - new ErrorResponse.ErrorResponseBuilder().setMessage("No feature manager is " + - "registered with the given type '" + type + "'").build()).build(); - } - features = fm.getFeatures(); - } catch (DeviceManagementException e) { - String msg = "Error occurred while retrieving the list of features of '" + type + "' device type"; - log.error(msg, e); - return Response.serverError().entity( - new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); - } - return Response.status(Response.Status.OK).entity(features).build(); - } - - @Override - @GET - @Path("/config") - public Response getDeviceTypes() { try { List deviceTypes = DeviceMgtAPIUtils.getDeviceManagementService().getDeviceTypes(); List filteredDeviceTypes = new ArrayList<>(); @@ -111,8 +82,8 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ @Override @GET - @Path("/config/{type}") - public Response getDeviceTypeByName(@PathParam("type") String type) { + @Path("/{type}") + public Response getDeviceTypeByName(@PathParam("type") @Size(max = 45) String type) { if (type != null && type.length() > 0) { try { DeviceType deviceType = DeviceMgtAPIUtils.getDeviceManagementService().getDeviceType(type); @@ -120,7 +91,7 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ String msg = "Device type does not exist, " + type; return Response.status(Response.Status.NO_CONTENT).entity(msg).build(); } - return Response.status(Response.Status.OK).entity(deviceType).build(); + return Response.status(Response.Status.OK).entity(clearMetaEntryInfo(deviceType)).build(); } catch (DeviceManagementException e) { String msg = "Error occurred at server side while fetching device type."; log.error(msg, e); @@ -131,10 +102,52 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ } } + @GET + @Override + @Path("/{type}/features") + public Response getFeatures(@PathParam("type") @Size(max = 45) String type, + @HeaderParam("If-Modified-Since") String ifModifiedSince) { + List features; + DeviceManagementProviderService dms; + try { + dms = DeviceMgtAPIUtils.getDeviceManagementService(); + FeatureManager fm = dms.getFeatureManager(type); + if (fm == null) { + features = new ArrayList<>(); + } else { + features = fm.getFeatures(); + } + } catch (DeviceManagementException e) { + String msg = "Error occurred while retrieving the list of features of '" + type + "' device type"; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + return Response.status(Response.Status.OK).entity(features).build(); + } + + @GET + @Override + @Path("/{type}/configs") + public Response getConfigs(@PathParam("type") @Size(max = 45) String type, + @HeaderParam("If-Modified-Since") String ifModifiedSince) { + PlatformConfiguration platformConfiguration; + try { + platformConfiguration = DeviceMgtAPIUtils.getDeviceManagementService().getConfiguration(type); + } catch (DeviceManagementException e) { + String msg = "Error occurred while retrieving the '" + type + "' platform configuration"; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + return Response.status(Response.Status.OK).entity(platformConfiguration).build(); + } + /** * This cleans up the configs that should not be exposed to iot users. - * @param deviceType - * @return + * + * @param deviceType device type retrieved from service layer. + * @return sanitized device type. */ private DeviceType clearMetaEntryInfo(DeviceType deviceType) { DeviceTypeMetaDefinition metaDefinition = deviceType.getDeviceTypeMetaDefinition(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java index 57c0b7cde62..d7f659871db 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java @@ -15,13 +15,31 @@ * specific language governing permissions and limitations * under the License. * + * + * Copyright (c) 2019, Entgra (pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * */ + package org.wso2.carbon.device.mgt.jaxrs.service.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.InvalidConfigurationException; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; @@ -33,6 +51,7 @@ 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.core.Response; @@ -63,6 +82,28 @@ public class DeviceTypeManagementAdminServiceImpl implements DeviceTypeManagemen } } + @Override + @GET + @Path("/{type}") + public Response getDeviceTypeByName(@PathParam("type") String type) { + if (type != null && type.length() > 0) { + try { + DeviceType deviceType = DeviceMgtAPIUtils.getDeviceManagementService().getDeviceType(type); + if (deviceType == null) { + String msg = "Device type does not exist, " + type; + return Response.status(Response.Status.NO_CONTENT).entity(msg).build(); + } + return Response.status(Response.Status.OK).entity(deviceType).build(); + } catch (DeviceManagementException e) { + String msg = "Error occurred at server side while fetching device type."; + log.error(msg, e); + return Response.serverError().entity(msg).build(); + } + } else { + return Response.status(Response.Status.BAD_REQUEST).build(); + } + } + @Override @POST public Response addDeviceType(DeviceType deviceType) { @@ -81,8 +122,8 @@ public class DeviceTypeManagementAdminServiceImpl implements DeviceTypeManagemen DeviceMgtAPIUtils.getDeviceManagementService().registerDeviceType(httpDeviceTypeManagerService); return Response.status(Response.Status.OK).build(); } else { - return Response.status(Response.Status.BAD_REQUEST).entity("Device type name does not match the pattern " - + DEVICETYPE_REGEX_PATTERN).build(); + return Response.status(Response.Status.BAD_REQUEST).entity("Device type name does not match " + + "the pattern " + DEVICETYPE_REGEX_PATTERN).build(); } } catch (DeviceManagementException e) { String msg = "Error occurred at server side while adding a device type."; @@ -96,11 +137,15 @@ public class DeviceTypeManagementAdminServiceImpl implements DeviceTypeManagemen @Override @PUT - public Response updateDeviceType(DeviceType deviceType) { + public Response updateDeviceType(String type, DeviceType deviceType) { if (deviceType != null && deviceType.getDeviceTypeMetaDefinition() != null) { + if (deviceType.getName() == null || !deviceType.getName().equals(type)) { + return Response.status(Response.Status.BAD_REQUEST).entity("Type name mismatch. Expected: '" + type + + "' Found: '"+ deviceType.getName() + "'").build(); + } try { - if (DeviceMgtAPIUtils.getDeviceManagementService().getDeviceType(deviceType.getName()) == null) { - String msg = "Device type does not exist, " + deviceType.getName(); + if (DeviceMgtAPIUtils.getDeviceManagementService().getDeviceType(type) == null) { + String msg = "Device type does not exist, " + type; return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); } DeviceManagementService httpDeviceTypeManagerService = DeviceMgtAPIUtils.getDeviceTypeGeneratorService() @@ -116,4 +161,22 @@ public class DeviceTypeManagementAdminServiceImpl implements DeviceTypeManagemen return Response.status(Response.Status.BAD_REQUEST).build(); } } + + @Override + public Response addDeviceTypePlatformConfig(String type, PlatformConfiguration platformConfiguration) { + boolean isSaved; + if (platformConfiguration.getType() == null || !platformConfiguration.getType().equals(type)) { + return Response.status(Response.Status.BAD_REQUEST).entity("Type name mismatch. Expected: '" + type + + "' Found: '"+ platformConfiguration.getType() + "'").build(); + } + try { + isSaved = DeviceMgtAPIUtils.getDeviceManagementService().saveConfiguration(platformConfiguration); + } catch (DeviceManagementException e) { + String msg = "Error occurred while retrieving the Android tenant configuration"; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + return Response.status(isSaved ? Response.Status.OK : Response.Status.BAD_REQUEST).build(); + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml index e1e2c46e8ca..7a2013037a5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -66,7 +66,7 @@ - + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index ffe9bcaa863..8e74ac0232d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -136,6 +136,7 @@ "perm:groups:devices-remove", "perm:groups:devices-add", "perm:groups:assign", + "perm:device-types:configs", "perm:device-types:features", "perm:device-types:types", "perm:applications:install", @@ -154,6 +155,8 @@ "perm:device-types:events", "perm:device-types:events:view", "perm:admin:device-type", + "perm:admin:device-type:view", + "perm:admin:device-type:configs", "perm:device:enroll", "perm:geo-service:analytics-view", "perm:geo-service:alerts-manage", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js index 16be67eb431..ca8fa6dbd82 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js @@ -303,7 +303,7 @@ deviceModule = function () { } return serviceInvokers.XMLHttp.get( url, function (responsePayload) { - return parse(responsePayload["responseText"])["count"]; + return parse(responsePayload["responseText"]).length; }, function (responsePayload) { log.error(responsePayload["responseText"]); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js index c973d079851..41afed6ae9f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js @@ -56,12 +56,12 @@ function onRequest(context) { var typesListResponse = deviceModule.getDeviceTypes(); var deviceTypes = []; if (typesListResponse["status"] == "success") { - var data = typesListResponse.content.deviceTypes; + var data = typesListResponse.content; if (data) { for (var i = 0; i < data.length; i++) { - var config = utility.getDeviceTypeConfig(data[i]); + var config = utility.getDeviceTypeConfig(data[i].name); var category = "iot"; - var label = data[i]; + var label = data[i].name; var analyticsEnabled = "false"; var groupingEnabled = "true"; var analyticsView = null; @@ -75,10 +75,10 @@ function onRequest(context) { } deviceTypes.push({ - "type": data[i], + "type": data[i].name, "category": category, "label": label, - "thumb": utility.getDeviceThumb(data[i]), + "thumb": utility.getDeviceThumb(data[i].name), "analyticsEnabled": analyticsEnabled, "groupingEnabled": groupingEnabled, "analyticsView" : analyticsView diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js index 9b0cdacddbc..23ee3e59d01 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js @@ -28,14 +28,14 @@ function onRequest(context) { var utility = require("/app/modules/utility.js").utility; var typesListResponse = deviceModule.getDeviceTypes(); if (typesListResponse["status"] == "success") { - var deviceTypes = typesListResponse.content.deviceTypes; + var deviceTypes = typesListResponse.content; if (deviceTypes) { if (deviceTypes.length > 0){ viewModel.hasDeviceTypes = true; } var deviceTypesList = [], virtualDeviceTypesList = []; for (var i = 0; i < deviceTypes.length; i++) { - var deviceType = deviceTypes[i]; + var deviceType = deviceTypes[i].name; var deviceTypeLabel = deviceType; var configs = utility.getDeviceTypeConfig(deviceTypeLabel); var deviceCategory = "device"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js index db1d8169a23..94f0b1235b2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js @@ -50,7 +50,7 @@ function onRequest(context) { types.isAuthorizedViewGroups = userModule.isAuthorized("/permission/admin/device-mgt/groups/view"); types["types"] = []; - var typesListResponse = deviceModule.getDeviceTypesConfig(); + var typesListResponse = deviceModule.getDeviceTypes(); if (typesListResponse["status"] == "success") { for (var type in typesListResponse["content"]) { var content = {}; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.js index 5bbd9926bf1..3fce92e8e7c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.js @@ -27,8 +27,8 @@ function onRequest(context) { return options.fn(this); } }); + var utility = require("/app/modules/utility.js").utility; var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; - var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; var constants = require("/app/modules/constants.js"); var uiPermissions = userModule.getUIPermissions(); @@ -43,15 +43,10 @@ function onRequest(context) { "device-mgt": [] }; - var typesListResponse = deviceModule.getDeviceTypesConfig(); - var temp = []; - temp = typesListResponse["content"]; var iosPluginFlag = false; - temp.forEach(function(element) { - if (element["name"] == "ios") { - iosPluginFlag = true; - } - }); + if (utility.getTenantedDeviceUnitName("ios", "type-view")) { + iosPluginFlag = true; + } context["iosPluginFlag"] = iosPluginFlag; // following context.link value comes here based on the value passed at the point From fbaf21adc68669bb1851976d1728ec6d4ddfb663 Mon Sep 17 00:00:00 2001 From: charitha Date: Wed, 17 Apr 2019 02:18:16 +0530 Subject: [PATCH 02/27] Add device type specific platform config UIs --- .../api/DeviceTypeManagementService.java | 2 +- .../impl/DeviceTypeManagementServiceImpl.java | 9 +- .../public/images/thumb.png | Bin 42033 -> 26701 bytes .../public/templates/applications-list.hbs | 2 +- .../configuration.hbs | 41 + .../configuration.json | 3 + .../configuration.hbs | 19 +- .../configuration.js | 33 +- .../public/js/platform-configuration.js | 198 +- .../cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs | 2 +- .../lib/font-wso2-1.3.0/css/font-wso2.css | 3004 ++++++++--------- .../lib/font-wso2-1.3.0/css/font-wso2.min.css | 30 +- 12 files changed, 1771 insertions(+), 1572 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.hbs create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.json diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java index db10142cc4c..1b59cfe4fd4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java @@ -348,7 +348,7 @@ public interface DeviceTypeManagementService { value = "The device type name, such as ios, android, windows or fire-alarm.", required = true) @PathParam("type") - @Size(max = 45) + @Size(min = 2, max = 45) String type, @ApiParam( name = "If-Modified-Since", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java index 2c22f76e77d..b20b3462de4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java @@ -83,7 +83,7 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ @Override @GET @Path("/{type}") - public Response getDeviceTypeByName(@PathParam("type") @Size(max = 45) String type) { + public Response getDeviceTypeByName(@PathParam("type") @Size(min = 2, max = 45) String type) { if (type != null && type.length() > 0) { try { DeviceType deviceType = DeviceMgtAPIUtils.getDeviceManagementService().getDeviceType(type); @@ -129,11 +129,16 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ @GET @Override @Path("/{type}/configs") - public Response getConfigs(@PathParam("type") @Size(max = 45) String type, + public Response getConfigs(@PathParam("type") @Size(min = 2, max = 45) String type, @HeaderParam("If-Modified-Since") String ifModifiedSince) { PlatformConfiguration platformConfiguration; try { platformConfiguration = DeviceMgtAPIUtils.getDeviceManagementService().getConfiguration(type); + if (platformConfiguration == null) { + platformConfiguration = new PlatformConfiguration(); + platformConfiguration.setType(type); + platformConfiguration.setConfiguration(new ArrayList<>()); + } } catch (DeviceManagementException e) { String msg = "Error occurred while retrieving the '" + type + "' platform configuration"; log.error(msg, e); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.type-view/public/images/thumb.png b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.type-view/public/images/thumb.png index 71e5c0c28b8161aab740a38422f10de5ca3ae955..109ed11017ae0b2a61e1ce0abd616cfbb462f916 100644 GIT binary patch literal 26701 zcmcF~g;yOv6z1UWS{z#3-K}Vm;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>a_Ws)OAPT3hIts z8WozK;EF??h#MRS3=r6prL~x+^~j{qn+3;1eq6x#^BVfLb@hV?+aFHqUu&vv2pp%@ zCkuuxCR>lC-7Rd&x-}H6@{&?&;T*``L9*3TL6h99)~#6GFS+hCTe*1V=V;^dC$3l3 zdP5sY*P50(p%0(avP?-f>s6SrtIGFO4vb?nSzMQNPOEwpjN{I595*d3AP+fZ**0$C z3=dvB#$1b0HY|dwVcJJ#Y%T0gG+Oayb=A+=Uh?Wc8D}VLp`o7Zx z9(xgV=$S6x61j^99xqpVBHJgKJd=K@9vfVlD-LdBPWg*w{ z7426}h#4OL`mJ!&`|{nQhwnyae&kr@T6od#{pMTwVXt#5qz|+0FnP7|_#ZXrp9Ku; zx65{JV0vB~9&@ACUq1Lv@V}ilM_-HoKJU2y>)so+s=!q=ulN6AbN^XTe`{RrT+#P?tK-q=n0&#)I*QBg|~u);d4{!^qz;Yas}{vFoOS1)*z@%`HA zWk%85Ze;?ah*PlAQ6L?nAgV#!x_WwfP?*6MEcKeOyh1o>rPgu`z<@TRH>u;~y z2W+`qF}nlYkbl*FW4#iv*>QIJzxoF+G|%n-v@ZT{^B>!qqko?)kN8eP+Z-e0h#h;x z8y;7``~ikRtKgq&KRPc;vp>Eb{k8w-o@b|D&q+=ysI+~*@psVvl8{S#K81*#y7u#|B^-p7O|K}I!+df}=zxC$9 zWZ*4^Nj(8#;p?A!GW?5`i2ucP`zNr-JwNM5;(vxkpZD1RUbJ^QaB*0^J}{6{pZ~s7 z|8@1!`>!YO19DZD|2{MSD`*%o?EV@1e>K++^Zyl}`w$qaqQK@~^l8vKj>>=E<^N^@ z>#$KBBRi}X-TZX_pNRTr=V$3o`SpEw=U=OrFpyTScXaoic`8SD@~w!sm;Gf$V?sC9 z^Q^nG_x!GpA?Gd~Vm7|$RdR^BzSFQj6 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/applications-list.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/applications-list.hbs index 8fba28621b7..2f6af71aa66 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/applications-list.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/applications-list.hbs @@ -3,7 +3,7 @@ {{#each applications}} {{#equal platform "android"}}{{/equal}} - {{#equal platform "ios"}}{{/equal}} + {{#equal platform "ios"}}{{/equal}} {{#equal platform "windows"}}{{/equal}} {{name}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.hbs new file mode 100644 index 00000000000..b4c64f7fd52 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.hbs @@ -0,0 +1,41 @@ +{{! + Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + + WSO2 Inc. licenses this file to you under the Apache License, + Version 2.0 (the "License"); you may not use this file except + in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +}} +
+ +
+ +
+
+
+ +
+
+
+{{#zone "bottomJs"}} + +{{/zone}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.json new file mode 100644 index 00000000000..fd259012978 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.dynamic.platform.configuration/configuration.json @@ -0,0 +1,3 @@ +{ + "version" : "1.0.0" +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs index 1d42bd01d80..597b38ce182 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs @@ -15,6 +15,11 @@ specific language governing permissions and limitations under the License. }} + +{{#zone "topCss"}} + {{css "css/platform-configuration.css"}} +{{/zone}} + {{#zone "content"}} {{#if isAuthorized}}
@@ -37,7 +42,7 @@
-
+
{{#unless isCloud}} @@ -63,7 +68,11 @@ - + {{#if unitName}} + + {{else}} + + {{/if}} {{label}} Configurations @@ -124,7 +133,11 @@ {{#each deviceTypes}} {{/each}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.js index 361579554ff..4fc10b836f4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.js @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ function onRequest(context) { @@ -29,23 +46,23 @@ function onRequest(context) { var deviceTypesArray = []; var typesListResponse = deviceModule.getDeviceTypes(); if (typesListResponse["status"] == "success") { - var data = typesListResponse["content"].deviceTypes; + var data = typesListResponse["content"]; if (data) { for (var i = 0; i < data.length; i++) { - var deviceTypeName = data[i]; + var deviceTypeName = data[i].name; + var deviceTypeLabel = deviceTypeName.charAt(0).toUpperCase() + deviceTypeName.slice(1);; var configUnitName = utility.getTenantedDeviceUnitName(deviceTypeName, "platform.configuration"); if (configUnitName) { var deviceTypeConfig = utility.getDeviceTypeConfig(deviceTypeName); - var deviceTypeLabel = deviceTypeName; if (deviceTypeConfig) { deviceTypeLabel = deviceTypeConfig.deviceType.label; } - deviceTypesArray.push({ - name: deviceTypeName, - label: deviceTypeLabel, - unitName: configUnitName - }); } + deviceTypesArray.push({ + name: deviceTypeName, + label: deviceTypeLabel, + unitName: configUnitName + }); } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/public/js/platform-configuration.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/public/js/platform-configuration.js index 45f753b4eda..d3a2152b06a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/public/js/platform-configuration.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/public/js/platform-configuration.js @@ -16,6 +16,8 @@ * under the License. */ +var configRowId = 0; + $(document).ready(function () { var configParams = { @@ -41,25 +43,25 @@ $(document).ready(function () { } invokerUtil.get( - "/api/device-mgt/v1.0/configuration", - function (data) { - data = JSON.parse(data); - if (data && data.configuration) { - for (var i = 0; i < data.configuration.length; i++) { - var config = data.configuration[i]; - if (config.name == configParams["NOTIFIER_FREQUENCY"]) { - $("input#monitoring-config-frequency").val(config.value / 1000); - } + "/api/device-mgt/v1.0/configuration", + function (data) { + data = JSON.parse(data); + if (data && data.configuration) { + for (var i = 0; i < data.configuration.length; i++) { + var config = data.configuration[i]; + if (config.name == configParams["NOTIFIER_FREQUENCY"]) { + $("input#monitoring-config-frequency").val(config.value / 1000); } } - }, function (data) { - console.log(data); - }); + } + }, function (data) { + console.log(data); + }); /** * Following click function would execute * when a user clicks on "Save" button - * on General platform configuration page in WSO2 EMM Console. + * on General platform configuration page in Entgra devicemgt Console. */ $("button#save-general-btn").click(function () { var notifierFrequency = $("input#monitoring-config-frequency").val(); @@ -87,33 +89,33 @@ $(document).ready(function () { var addConfigAPI = "/api/device-mgt/v1.0/configuration"; invokerUtil.put( - addConfigAPI, - addConfigFormData, - function (data, textStatus, jqXHR) { - data = jqXHR.status; - if (data == 200) { - $("#config-save-form").addClass("hidden"); - $("#record-created-msg").removeClass("hidden"); - } else if (data == 500) { - $(errorMsg).text("Exception occurred at backend."); - } else if (data == 403) { - $(errorMsg).text("Action was not permitted."); - } else { - $(errorMsg).text("An unexpected error occurred."); - } - - $(errorMsgWrapper).removeClass("hidden"); - }, function (data) { - data = data.status; - if (data == 500) { - $(errorMsg).text("Exception occurred at backend."); - } else if (data == 403) { - $(errorMsg).text("Action was not permitted."); - } else { - $(errorMsg).text("An unexpected error occurred."); - } - $(errorMsgWrapper).removeClass("hidden"); + addConfigAPI, + addConfigFormData, + function (data, textStatus, jqXHR) { + data = jqXHR.status; + if (data == 200) { + $("#config-save-form").addClass("hidden"); + $("#record-created-msg").removeClass("hidden"); + } else if (data == 500) { + $(errorMsg).text("Exception occurred at backend."); + } else if (data == 403) { + $(errorMsg).text("Action was not permitted."); + } else { + $(errorMsg).text("An unexpected error occurred."); + } + + $(errorMsgWrapper).removeClass("hidden"); + }, function (data) { + data = data.status; + if (data == 500) { + $(errorMsg).text("Exception occurred at backend."); + } else if (data == 403) { + $(errorMsg).text("Action was not permitted."); + } else { + $(errorMsg).text("An unexpected error occurred."); } + $(errorMsgWrapper).removeClass("hidden"); + } ); } }); @@ -154,3 +156,121 @@ var artifactGeoUpload = function () { showPopup(); }, contentType); }; + +var loadDynamicDeviceTypeConfig = function (deviceType) { + var configAPI = '/api/device-mgt/v1.0/device-types/' + deviceType + '/configs'; + invokerUtil.get( + configAPI, + function (data) { + data = JSON.parse(data); + var fieldWrapper = "#" + deviceType + "-config-field-wrapper"; + $(fieldWrapper).html(""); + if (data.configuration) { + var config; + var i; + for (i = 0; i < data.configuration.length; i++) { + config = data.configuration[i]; + onDynamicConfigAddNew(deviceType, config.name, config.value); + } + } + $(fieldWrapper).append( + '
' + + '
' + + '' + + '
' + + '
' + + '' + + '
' + + '' + + '
' + ); + }, function (data) { + console.log(data); + } + ); +}; + +var onDynamicConfigSubmit = function (deviceType) { + + var errorMsgWrapper = "#" + deviceType + "-config-error-msg"; + var errorMsg = "#" + deviceType + "-config-error-msg span"; + + var addConfigFormData = {}; + var configList = []; + + $('.' + deviceType + '-config-row').each(function () { + var configName = $(this).find("." + deviceType + "-config-name").val(); + var configVal = $(this).find("." + deviceType + "-config-value").val(); + if (configName && configName.trim() !== "" && configVal && configVal.trim() !== "") { + var configurationEntry = {}; + configurationEntry.name = configName.trim(); + configurationEntry.contentType = "text"; + configurationEntry.value = configVal.trim(); + configList.push(configurationEntry); + } + }); + + addConfigFormData.type = deviceType; + addConfigFormData.configuration = configList; + + var addConfigAPI = '/api/device-mgt/v1.0/admin/device-types/' + deviceType + '/configs'; + + invokerUtil.post( + addConfigAPI, + addConfigFormData, + function (data, textStatus, jqXHR) { + data = jqXHR.status; + if (data == 200) { + $("#config-save-form").addClass("hidden"); + $("#record-created-msg").removeClass("hidden"); + } else if (data == 500) { + $(errorMsg).text("Exception occurred at backend."); + } else if (data == 400) { + $(errorMsg).text("Configurations cannot be empty."); + } else { + $(errorMsg).text("An unexpected error occurred."); + } + + $(errorMsgWrapper).removeClass("hidden"); + }, function (data) { + data = data.status; + if (data == 500) { + $(errorMsg).text("Exception occurred at backend."); + } else if (data == 403) { + $(errorMsg).text("Action was not permitted."); + } else { + $(errorMsg).text("An unexpected error occurred."); + } + $(errorMsgWrapper).removeClass("hidden"); + } + ); +}; + +var onDynamicConfigAddNew = function (deviceType, name, value) { + $("#" + deviceType + "-config-field-wrapper").append( + '
' + + '
' + + '' + + '
' + + '
' + + '' + + '
' + + '' + + '
' + ); +}; + +var onDynamicConfigRemove = function (deviceType, rawId) { + $("#" + deviceType + "-config-row-" + rawId).remove() +}; \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs index b071abf81d8..8c80bd6fc77 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs @@ -118,7 +118,7 @@ {{/if}} {{#if iosPluginFlag}}
  • - + DEP Configurations
  • diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.css index 870013db199..c6544d6f2eb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.css @@ -1,1506 +1,1506 @@ -/*! -~ Copyright (c) WSO2 Inc. (http://wso2.com) All Rights Reserved. -~ -~ Licensed under the Apache License, Version 2.0 (the "License"); -~ you may not use this file except in compliance with the License. -~ You may obtain a copy of the License at -~ -~ http://www.apache.org/licenses/LICENSE-2.0 -~ -~ Unless required by applicable law or agreed to in writing, software -~ distributed under the License is distributed on an "AS IS" BASIS, -~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -~ See the License for the specific language governing permissions and -~ limitations under the License. -*/ - - -@font-face { - font-family:"font-wso2"; - src:local("font-wso2"), url("../fonts/font-wso2.eot?6563fa91278f239ef8c827d90a165223"); - src:local("font-wso2"), +/*! +~ Copyright (c) WSO2 Inc. (http://wso2.com) All Rights Reserved. +~ +~ Licensed under the Apache License, Version 2.0 (the "License"); +~ you may not use this file except in compliance with the License. +~ You may obtain a copy of the License at +~ +~ http://www.apache.org/licenses/LICENSE-2.0 +~ +~ Unless required by applicable law or agreed to in writing, software +~ distributed under the License is distributed on an "AS IS" BASIS, +~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~ See the License for the specific language governing permissions and +~ limitations under the License. +*/ + + +@font-face { + font-family:"font-wso2"; + src:local("font-wso2"), url("../fonts/font-wso2.eot?6563fa91278f239ef8c827d90a165223"); + src:local("font-wso2"), url("../fonts/font-wso2.eot?#iefix") format("embedded-opentype"), url("../fonts/font-wso2.woff2?6563fa91278f239ef8c827d90a165223") format("woff2"), url("../fonts/font-wso2.woff?6563fa91278f239ef8c827d90a165223") format("woff"), url("../fonts/font-wso2.ttf?6563fa91278f239ef8c827d90a165223") format("truetype"), - url("../fonts/font-wso2.svg?6563fa91278f239ef8c827d90a165223#font-wso2") format("svg"); - font-weight:normal; - font-style:normal; -} - -.fw, [class^="fw-"], [class*=" fw-"] { - font: normal normal normal 14px/1 font-wso2; - display: inline-block; - font-weight: normal; - font-style: normal; - font-size: inherit; - font-variant: normal; - speak: none; - text-decoration: inherit; - - /* Better Font Rendering =========== */ - text-transform: none; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - - -/* ======================================================================== - * font options - * ======================================================================== */ - -.fw-lg { - font-size: 1.33333333em; - line-height: 0.75em; - vertical-align: -15%; -} -.fw-2x { - font-size: 2em; -} -.fw-3x { - font-size: 3em; -} -.fw-4x { - font-size: 4em; -} -.fw-5x { - font-size: 5em; -} -.fw-fw { - width: 1.28571429em; - text-align: center; -} -.fw-ul { - padding-left: 0; - margin-left: 2.14285714em; - list-style-type: none; -} -.fw-ul > li { - position: relative; -} -.fw-li { - position: absolute; - left: -2.14285714em; - width: 2.14285714em; - top: 0.14285714em; - text-align: center; -} -.fw-li.fw-lg { - left: -1.85714286em; -} -.fw-border { - padding: .2em .25em .15em; - border: solid 0.08em #eeeeee; - border-radius: .1em; -} -.fw-background { - background: #888; - border-radius: .3em; - padding: .4em .50em .45em; -} -.fw-pull-left { - float: left; -} -.fw-pull-right { - float: right; -} -.fw.fw-pull-left { - margin-right: .3em; -} -.fw.fw-pull-right { - margin-left: .3em; -} -.fw-spin { - -webkit-animation: fw-spin 2s infinite linear; - animation: fw-spin 2s infinite linear; -} -@-webkit-keyframes fw-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} -@keyframes fw-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} -.fw-pulse { - -webkit-animation: fw-pulse 2s ease-out infinite; - animation: fw-pulse 2s ease-out infinite; -} -@-webkit-keyframes fw-pulse { - 0%, 30% { - opacity: 0.3; - } - 40% { - opacity: 1; - } - 100% { - opacity: 0.3; - } -} -@keyframes fw-pulse { - 0%, 30% { - opacity: 0.3; - } - 40% { - opacity: 1; - } - 100% { - opacity: 0.3; - } -} -.fw-rotate-90 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); - -webkit-transform: rotate(90deg); - -ms-transform: rotate(90deg); - transform: rotate(90deg); -} -.fw-rotate-180 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); - -webkit-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} -.fw-rotate-270 { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); - -webkit-transform: rotate(270deg); - -ms-transform: rotate(270deg); - transform: rotate(270deg); -} -.fw-flip-horizontal { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); - -webkit-transform: scale(-1, 1); - -ms-transform: scale(-1, 1); - transform: scale(-1, 1); -} -.fw-flip-vertical { - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); - -webkit-transform: scale(1, -1); - -ms-transform: scale(1, -1); - transform: scale(1, -1); -} -:root .fw-rotate-90, -:root .fw-rotate-180, -:root .fw-rotate-270, -:root .fw-flip-horizontal, -:root .fw-flip-vertical { - filter: none; -} -.fw-stack, -.fw-helper { - position: relative; - display: inline-block; - width: 2em; - height: 2em; - line-height: 1.85em; - vertical-align: middle; -} -.fw-stack-1x, -.fw-stack-2x, -.fw-helper:before, -.fw-helper:after { - position: absolute; - left: 0; - width: 100%; - text-align: center; -} -.fw-stack-1x, -.fw-helper:before { - line-height: inherit; -} -.fw-stack-2x, -.fw-helper:after { - font-size: 1.9em; -} -.fw-helper-slash:before { - font-size: 1.4em; -} -.fw-helper-circle:before, -.fw-helper-square:before { - z-index: 1; -} -.fw-helper-circle-outline:after { - content: "\e61f"; -} -.fw-helper-circle:after { - content: "\e61a"; -} -.fw-helper-square-outline:after { - content: "\e6b2"; -} -.fw-helper-square:after { - content: "\e6b1"; -} -.fw-helper-slash:after { - content: "\e6e1"; -} -.fw-stack > .fw-stack { - position: absolute; - font-size: 0.5em; -} -.fw-stack > .fw-stack.fw-move-top { - top: -0.2em; -} -.fw-stack > .fw-stack.fw-move-bottom { - bottom: -0.2em; -} -.fw-stack > .fw.stack.fw-move-left { - left: -0.5em; -} -.fw-stack > .fw-stack.fw-move-right { - right: -0.5em; -} -.fw-inverse:before, -.fw-helper-inverse:after, -.fw-number { - color: #ffffff; -} -.fw-shadow:before, -.fw-helper-shadow:after { - text-shadow: #ffffff 1px 1px 0; -} -.fw-stroke:before, -.fw-helper-stroke:after { - text-shadow: -2px -2px 0 #ffffff, - 2px -2px 0 #ffffff, - -2px 2px 0 #ffffff, - 2px 2px 0 #ffffff; -} -.fw-number { - line-height: 2em; - font-family: Arial, Helvetica, sans-serif; -} - - -/* ======================================================================== - * font icons - * ======================================================================== */ - -.fw-abort:before { - content:"\e72a"; -} - -.fw-action-invoke:before { - content:"\e6fe"; -} - -.fw-action:before { - content:"\e709"; -} - -.fw-activate:before { - content:"\e6cf"; -} - -.fw-add:before { - content:"\e615"; -} - -.fw-airplay:before { - content:"\e600"; -} - -.fw-alarm:before { - content:"\e6c2"; -} - -.fw-alert:before { - content:"\e6be"; -} - -.fw-analytics-extensions:before { - content:"\e6e2"; -} - -.fw-android-logcat:before { - content:"\e72c"; -} - -.fw-android-sense:before { - content:"\e72d"; -} - -.fw-android:before { - content:"\e606"; -} - -.fw-annotation:before { - content:"\e6e6"; -} - -.fw-api:before { - content:"\e601"; -} - -.fw-apn:before { - content:"\e602"; -} - -.fw-apple:before { - content:"\e604"; -} - -.fw-application:before { - content:"\e608"; -} - -.fw-arduino:before { - content:"\e6ab"; -} - -.fw-assign:before { - content:"\e6ff"; -} - -.fw-ballerina-service:before { - content:"\e729"; -} - -.fw-ballerina:before { - content:"\e728"; -} - -.fw-bar-chart:before { - content:"\e690"; -} - -.fw-battery:before { - content:"\e60a"; -} - -.fw-blank-document:before { - content:"\e60c"; -} - -.fw-block:before { - content:"\e695"; -} - -.fw-bookmark:before { - content:"\e60d"; -} - -.fw-bpel:before { - content:"\e60e"; -} - -.fw-bpmn:before { - content:"\e60f"; -} - -.fw-break:before { - content:"\e721"; -} - -.fw-bug:before { - content:"\e611"; -} - -.fw-build:before { - content:"\e6c1"; -} - -.fw-calendar:before { - content:"\e612"; -} - -.fw-camera:before { - content:"\e613"; -} - -.fw-cancel:before { - content:"\e618"; -} - -.fw-carbon:before { - content:"\e6c5"; -} - -.fw-chat:before { - content:"\e65b"; -} - -.fw-check:before { - content:"\e617"; -} - -.fw-checklist:before { - content:"\e619"; -} - -.fw-circle-outline:before { - content:"\e61f"; -} - -.fw-circle:before { - content:"\e61a"; -} - -.fw-clear:before { - content:"\e61b"; -} - -.fw-clock:before { - content:"\e61d"; -} - -.fw-cloud:before { - content:"\e61e"; -} - -.fw-code-view:before { - content:"\e70e"; -} - -.fw-code:before { - content:"\e6f1"; -} - -.fw-comment:before { - content:"\e710"; -} - -.fw-compare:before { - content:"\e610"; -} - -.fw-computer:before { - content:"\e653"; -} - -.fw-configarations:before { - content:"\e609"; -} - -.fw-connector:before { - content:"\e700"; -} - -.fw-console:before { - content:"\e71d"; -} - -.fw-constant:before { - content:"\e701"; -} - -.fw-contact:before { - content:"\e620"; -} - -.fw-contract:before { - content:"\e614"; -} - -.fw-copy:before { - content:"\e621"; -} - -.fw-cut:before { - content:"\e6f2"; -} - -.fw-dashboard:before { - content:"\e622"; -} - -.fw-database:before { - content:"\e623"; -} - -.fw-delete:before { - content:"\e624"; -} - -.fw-depend:before { - content:"\e6c6"; -} - -.fw-deploy:before { - content:"\e625"; -} - -.fw-deprecate:before { - content:"\e6cb"; -} - -.fw-design-view:before { - content:"\e70f"; -} - -.fw-devices:before { - content:"\e704"; -} - -.fw-dgm-action-invoke:before { - content:"\e712"; -} - -.fw-dgm-action:before { - content:"\e711"; -} - -.fw-dgm-connector:before { - content:"\e6f4"; -} - -.fw-dgm-constant-definition:before { - content:"\e6f5"; -} - -.fw-dgm-fork:before { - content:"\e6e7"; -} - -.fw-dgm-header:before { - content:"\e6e8"; -} - -.fw-dgm-if-else:before { - content:"\e6e9"; -} - -.fw-dgm-import:before { - content:"\e717"; -} - -.fw-dgm-lifeline:before { - content:"\e6ea"; -} - -.fw-dgm-logger:before { - content:"\e6eb"; -} - -.fw-dgm-resource:before { - content:"\e6f6"; -} - -.fw-dgm-service:before { - content:"\e6f7"; -} - -.fw-dgm-try-catch:before { - content:"\e6ec"; -} - -.fw-dgm-type-convertor:before { - content:"\e6f8"; -} - -.fw-dgm-type:before { - content:"\e6f9"; -} - -.fw-dgm-while:before { - content:"\e707"; -} - -.fw-dial-up:before { - content:"\e627"; -} - -.fw-disabled:before { - content:"\e6d1"; -} - -.fw-display:before { - content:"\e626"; -} - -.fw-docker:before { - content:"\e70c"; -} - -.fw-document:before { - content:"\e628"; -} - -.fw-down-arrow:before { - content:"\e689"; -} - -.fw-down:before { - content:"\e685"; -} - -.fw-download:before { - content:"\e65f"; -} - -.fw-dss:before { - content:"\e62a"; -} - -.fw-ebook:before { - content:"\e62b"; -} - -.fw-edit:before { - content:"\e62c"; -} - -.fw-ellipsis:before { - content:"\e629"; -} - -.fw-endpoint:before { - content:"\e62d"; -} - -.fw-enterprise:before { - content:"\e6b6"; -} - -.fw-error:before { - content:"\e630"; -} - -.fw-esb-connector:before { - content:"\e6e3"; -} - -.fw-expand:before { - content:"\e61c"; -} - -.fw-export:before { - content:"\e631"; -} - -.fw-extensions:before { - content:"\e6e4"; -} - -.fw-facebook:before { - content:"\e6d3"; -} - -.fw-factory-reset:before { - content:"\e632"; -} - -.fw-fan:before { - content:"\e678"; -} - -.fw-faq:before { - content:"\e62f"; -} - -.fw-file-browse:before { - content:"\e633"; -} - -.fw-filter:before { - content:"\e634"; -} - -.fw-folder-open:before { - content:"\e70b"; -} - -.fw-folder:before { - content:"\e62e"; -} - -.fw-fork-join:before { - content:"\e720"; -} - -.fw-format:before { - content:"\e6fa"; -} - -.fw-forum:before { - content:"\e636"; -} - -.fw-function-invoke:before { - content:"\e713"; -} - -.fw-function:before { - content:"\e6fb"; -} - -.fw-gadget:before { - content:"\e637"; -} - -.fw-geo-fence-inbound:before { - content:"\e72e"; -} - -.fw-geo-fence-outbound:before { - content:"\e72f"; -} - -.fw-github:before { - content:"\e6d4"; -} - -.fw-globe:before { - content:"\e697"; -} - -.fw-google-docs:before { - content:"\e6d6"; -} - -.fw-google-drive:before { - content:"\e6da"; -} - -.fw-google-plus:before { - content:"\e6d9"; -} - -.fw-google-sheets:before { - content:"\e6d7"; -} - -.fw-google-slides:before { - content:"\e6d8"; -} - -.fw-google:before { - content:"\e6d5"; -} - -.fw-grid:before { - content:"\e638"; -} - -.fw-grip:before { - content:"\e6b7"; -} - -.fw-group:before { - content:"\e6af"; -} - -.fw-hardware:before { - content:"\e6a9"; -} - -.fw-hdd:before { - content:"\e639"; -} - -.fw-heart:before { - content:"\e6c3"; -} - -.fw-hide:before { - content:"\e6d2"; -} - -.fw-home:before { - content:"\e63a"; -} - -.fw-hour-glass:before { - content:"\e63b"; -} - -.fw-html:before { - content:"\e69d"; -} - -.fw-http:before { - content:"\e705"; -} - -.fw-image:before { - content:"\e70a"; -} - -.fw-import:before { - content:"\e63c"; -} - -.fw-incoming-call:before { - content:"\e63d"; -} - -.fw-info:before { - content:"\e63e"; -} - -.fw-instagram:before { - content:"\e6db"; -} - -.fw-invitation:before { - content:"\e63f"; -} - -.fw-invoke:before { - content:"\e6ed"; -} - -.fw-is-connector:before { - content:"\e6e5"; -} - -.fw-iterate:before { - content:"\e71f"; -} - -.fw-jaggery:before { - content:"\e640"; -} - -.fw-java-spring:before { - content:"\e644"; -} - -.fw-java:before { - content:"\e641"; -} - -.fw-javaee:before { - content:"\e642"; -} - -.fw-javascript:before { - content:"\e643"; -} - -.fw-jaxrs:before { - content:"\e645"; -} - -.fw-jaxws:before { - content:"\e6c7"; -} - -.fw-jquery:before { - content:"\e646"; -} - -.fw-key:before { - content:"\e647"; -} - -.fw-laptop:before { - content:"\e648"; -} - -.fw-layout:before { - content:"\e6bf"; -} - -.fw-ldap:before { - content:"\e649"; -} - -.fw-left-arrow:before { - content:"\e68a"; -} - -.fw-left:before { - content:"\e686"; -} - -.fw-lifecycle:before { - content:"\e64a"; -} - -.fw-light:before { - content:"\e680"; -} - -.fw-linkedin:before { - content:"\e6dc"; -} - -.fw-list-sort:before { - content:"\e64d"; -} - -.fw-list:before { - content:"\e64c"; -} - -.fw-loader:before { - content:"\e6b4"; -} - -.fw-loader2:before { - content:"\e6ba"; -} - -.fw-loader3:before { - content:"\e6bb"; -} - -.fw-loader4:before { - content:"\e6bc"; -} - -.fw-loader5:before { - content:"\e6bd"; -} - -.fw-lock:before { - content:"\e64e"; -} - -.fw-logical:before { - content:"\e702"; -} - -.fw-mail:before { - content:"\e64f"; -} - -.fw-main-function:before { - content:"\e706"; -} - -.fw-map-location:before { - content:"\e650"; -} - -.fw-menu:before { - content:"\e651"; -} - -.fw-message:before { - content:"\e635"; -} - -.fw-micro-services:before { - content:"\e6ce"; -} - -.fw-minus:before, .fw-hyphen:before, .fw-dash:before { - content:"\e616"; -} - -.fw-mobile:before { - content:"\e652"; -} - -.fw-ms-document:before { - content:"\e654"; -} - -.fw-mute:before { - content:"\e655"; -} - -.fw-nodejs:before { - content:"\e656"; -} - -.fw-notification:before { - content:"\e60b"; -} - -.fw-organization:before { - content:"\e6ac"; -} - -.fw-own:before { - content:"\e6c8"; -} - -.fw-package:before { - content:"\e6fd"; -} - -.fw-pages:before { - content:"\e6c0"; -} - -.fw-paste:before { - content:"\e658"; -} - -.fw-pdf:before { - content:"\e659"; -} - -.fw-pending:before { - content:"\e727"; -} - -.fw-php:before { - content:"\e6c9"; -} - -.fw-pie-chart:before { - content:"\e65a"; -} - -.fw-pinterest:before { - content:"\e6dd"; -} - -.fw-policy:before { - content:"\e67d"; -} - -.fw-polygon:before { - content:"\e70d"; -} - -.fw-prototype:before { - content:"\e6cc"; -} - -.fw-proxy:before { - content:"\e699"; -} - -.fw-public:before { - content:"\e6ad"; -} - -.fw-publish:before { - content:"\e65c"; -} - -.fw-question:before { - content:"\e6b0"; -} - -.fw-raspberry:before { - content:"\e6aa"; -} - -.fw-redo:before { - content:"\e65d"; -} - -.fw-refresh:before { - content:"\e692"; -} - -.fw-register:before { - content:"\e65e"; -} - -.fw-rename:before { - content:"\e6fc"; -} - -.fw-reply:before { - content:"\e714"; -} - -.fw-resource:before { - content:"\e660"; -} - -.fw-rest-api:before { - content:"\e661"; -} - -.fw-rest-service:before { - content:"\e662"; -} - -.fw-resume:before { - content:"\e71e"; -} - -.fw-retire:before { - content:"\e6cd"; -} - -.fw-return:before { - content:"\e715"; -} - -.fw-retweet:before { - content:"\e6b9"; -} - -.fw-right-arrow:before { - content:"\e68b"; -} - -.fw-right:before { - content:"\e687"; -} - -.fw-ringing:before { - content:"\e694"; -} - -.fw-rules:before { - content:"\e664"; -} - -.fw-run:before { - content:"\e708"; -} - -.fw-save:before { - content:"\e665"; -} - -.fw-scep:before { - content:"\e666"; -} - -.fw-schema:before { - content:"\e667"; -} - -.fw-search:before { - content:"\e668"; -} - -.fw-security-policy:before { - content:"\e67e"; -} - -.fw-security:before { - content:"\e669"; -} - -.fw-send:before, .fw-paper-rocket:before { - content:"\e66a"; -} - -.fw-sequence:before { - content:"\e66b"; -} - -.fw-server:before { - content:"\e66c"; -} - -.fw-service-provider:before { - content:"\e66e"; -} - -.fw-service:before, .fw-cogwheels:before, .fw-gears:before, .fw-sprockets:before { - content:"\e66d"; -} - -.fw-settings:before, .fw-cogwheel:before, .fw-gear:before, .fw-sprocket:before { - content:"\e66f"; -} - -.fw-share:before { - content:"\e670"; -} - -.fw-shell:before { - content:"\e730"; -} - -.fw-shortcut:before { - content:"\e725"; -} - -.fw-sign-in:before { - content:"\e671"; -} - -.fw-sign-out:before { - content:"\e6b8"; -} - -.fw-skype:before { - content:"\e6de"; -} - -.fw-slash:before { - content:"\e6e1"; -} - -.fw-soap:before { - content:"\e672"; -} - -.fw-sort-down:before { - content:"\e663"; -} - -.fw-sort-up:before { - content:"\e64b"; -} - -.fw-sort:before { - content:"\e673"; -} - -.fw-speed-alert:before { - content:"\e731"; -} - -.fw-square-outline:before { - content:"\e6b2"; -} - -.fw-square:before { - content:"\e6b1"; -} - -.fw-star:before { - content:"\e674"; -} - -.fw-start:before { - content:"\e718"; -} - -.fw-statistics:before { - content:"\e675"; -} - -.fw-stepin:before { - content:"\e719"; -} - -.fw-stepout:before { - content:"\e71a"; -} - -.fw-stepover:before { - content:"\e71b"; -} - -.fw-stop:before { - content:"\e71c"; -} - -.fw-store:before, .fw-cart:before { - content:"\e676"; -} - -.fw-struct:before { - content:"\e716"; -} - -.fw-subscribe:before { - content:"\e677"; -} - -.fw-success:before { - content:"\e657"; -} - -.fw-swagger:before { - content:"\e679"; -} - -.fw-sync:before { - content:"\e6b3"; -} - -.fw-table:before { - content:"\e6c4"; -} - -.fw-tag:before { - content:"\e67a"; -} - -.fw-task:before { - content:"\e67b"; -} - -.fw-text:before { - content:"\e67c"; -} - -.fw-theme:before { - content:"\e726"; -} - -.fw-throttling-policy:before { - content:"\e67f"; -} - -.fw-throw:before { - content:"\e722"; -} - -.fw-tiles:before { - content:"\e681"; -} - -.fw-transaction:before { - content:"\e72b"; -} - -.fw-try-catch:before { - content:"\e703"; -} - -.fw-twitter:before { - content:"\e6df"; -} - -.fw-type-converter:before { - content:"\e6f3"; -} - -.fw-uncheck:before { - content:"\e682"; -} - -.fw-undo:before { - content:"\e683"; -} - -.fw-ungroup:before { - content:"\e6b5"; -} - -.fw-unmute:before { - content:"\e6ae"; -} - -.fw-up-arrow:before { - content:"\e688"; -} - -.fw-up:before { - content:"\e684"; -} - -.fw-upload:before { - content:"\e68c"; -} - -.fw-uri:before { - content:"\e68d"; -} - -.fw-usb-drive:before { - content:"\e68e"; -} - -.fw-use:before { - content:"\e6ca"; -} - -.fw-user:before { - content:"\e68f"; -} - -.fw-variable:before { - content:"\e6ee"; -} - -.fw-view:before { - content:"\e691"; -} - -.fw-vpn:before { - content:"\e603"; -} - -.fw-wadl:before { - content:"\e6a1"; -} - -.fw-war:before { - content:"\e69e"; -} - -.fw-warning:before { - content:"\e693"; -} - -.fw-web-app:before { - content:"\e696"; -} - -.fw-web-clip:before { - content:"\e698"; -} - -.fw-web-service:before { - content:"\e69a"; -} - -.fw-website:before { - content:"\e69b"; -} - -.fw-wifi:before { - content:"\e607"; -} - -.fw-windows:before { - content:"\e605"; -} - -.fw-worker-invoke:before { - content:"\e723"; -} - -.fw-worker-reply:before { - content:"\e724"; -} - -.fw-worker:before { - content:"\e6ef"; -} - -.fw-wsdl:before { - content:"\e6a0"; -} - -.fw-wso2-logo:before { - content:"\e6a7"; -} - -.fw-wso2:before { - content:"\e6a8"; -} - -.fw-xacml:before { - content:"\e69f"; -} - -.fw-xml:before { - content:"\e69c"; -} - -.fw-xq:before { - content:"\e6a2"; -} - -.fw-xsd:before { - content:"\e6a3"; -} - -.fw-xslt:before { - content:"\e6a4"; -} - -.fw-youtube:before { - content:"\e6e0"; -} - -.fw-zoom-in:before { - content:"\e6a5"; -} - -.fw-zoom-out:before { - content:"\e6a6"; -} - + url("../fonts/font-wso2.svg?6563fa91278f239ef8c827d90a165223#font-wso2") format("svg"); + font-weight:normal; + font-style:normal; +} + +.fw, [class^="fw-"], [class*=" fw-"] { + font: normal normal normal 14px/1 font-wso2; + display: inline-block; + font-weight: normal; + font-style: normal; + font-size: inherit; + font-variant: normal; + speak: none; + text-decoration: inherit; + + /* Better Font Rendering =========== */ + text-transform: none; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + + +/* ======================================================================== + * font options + * ======================================================================== */ + +.fw-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fw-2x { + font-size: 2em; +} +.fw-3x { + font-size: 3em; +} +.fw-4x { + font-size: 4em; +} +.fw-5x { + font-size: 5em; +} +.fw-fw { + width: 1.28571429em; + text-align: center; +} +.fw-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fw-ul > li { + position: relative; +} +.fw-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fw-li.fw-lg { + left: -1.85714286em; +} +.fw-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.fw-background { + background: #888; + border-radius: .3em; + padding: .4em .50em .45em; +} +.fw-pull-left { + float: left; +} +.fw-pull-right { + float: right; +} +.fw.fw-pull-left { + margin-right: .3em; +} +.fw.fw-pull-right { + margin-left: .3em; +} +.fw-spin { + -webkit-animation: fw-spin 2s infinite linear; + animation: fw-spin 2s infinite linear; +} +@-webkit-keyframes fw-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes fw-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +.fw-pulse { + -webkit-animation: fw-pulse 2s ease-out infinite; + animation: fw-pulse 2s ease-out infinite; +} +@-webkit-keyframes fw-pulse { + 0%, 30% { + opacity: 0.3; + } + 40% { + opacity: 1; + } + 100% { + opacity: 0.3; + } +} +@keyframes fw-pulse { + 0%, 30% { + opacity: 0.3; + } + 40% { + opacity: 1; + } + 100% { + opacity: 0.3; + } +} +.fw-rotate-90 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.fw-rotate-180 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.fw-rotate-270 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); +} +.fw-flip-horizontal { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fw-flip-vertical { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} +:root .fw-rotate-90, +:root .fw-rotate-180, +:root .fw-rotate-270, +:root .fw-flip-horizontal, +:root .fw-flip-vertical { + filter: none; +} +.fw-stack, +.fw-helper { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 1.85em; + vertical-align: middle; +} +.fw-stack-1x, +.fw-stack-2x, +.fw-helper:before, +.fw-helper:after { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fw-stack-1x, +.fw-helper:before { + line-height: inherit; +} +.fw-stack-2x, +.fw-helper:after { + font-size: 1.9em; +} +.fw-helper-slash:before { + font-size: 1.4em; +} +.fw-helper-circle:before, +.fw-helper-square:before { + z-index: 1; +} +.fw-helper-circle-outline:after { + content: "\e61f"; +} +.fw-helper-circle:after { + content: "\e61a"; +} +.fw-helper-square-outline:after { + content: "\e6b2"; +} +.fw-helper-square:after { + content: "\e6b1"; +} +.fw-helper-slash:after { + content: "\e6e1"; +} +.fw-stack > .fw-stack { + position: absolute; + font-size: 0.5em; +} +.fw-stack > .fw-stack.fw-move-top { + top: -0.2em; +} +.fw-stack > .fw-stack.fw-move-bottom { + bottom: -0.2em; +} +.fw-stack > .fw.stack.fw-move-left { + left: -0.5em; +} +.fw-stack > .fw-stack.fw-move-right { + right: -0.5em; +} +.fw-inverse:before, +.fw-helper-inverse:after, +.fw-number { + color: #ffffff; +} +.fw-shadow:before, +.fw-helper-shadow:after { + text-shadow: #ffffff 1px 1px 0; +} +.fw-stroke:before, +.fw-helper-stroke:after { + text-shadow: -2px -2px 0 #ffffff, + 2px -2px 0 #ffffff, + -2px 2px 0 #ffffff, + 2px 2px 0 #ffffff; +} +.fw-number { + line-height: 2em; + font-family: Arial, Helvetica, sans-serif; +} + + +/* ======================================================================== + * font icons + * ======================================================================== */ + +.fw-abort:before { + content:"\e72a"; +} + +.fw-action-invoke:before { + content:"\e6fe"; +} + +.fw-action:before { + content:"\e709"; +} + +.fw-activate:before { + content:"\e6cf"; +} + +.fw-add:before { + content:"\e615"; +} + +.fw-airplay:before { + content:"\e600"; +} + +.fw-alarm:before { + content:"\e6c2"; +} + +.fw-alert:before { + content:"\e6be"; +} + +.fw-analytics-extensions:before { + content:"\e6e2"; +} + +.fw-android-logcat:before { + content:"\e72c"; +} + +.fw-android-sense:before { + content:"\e72d"; +} + +.fw-android:before { + content:"\e606"; +} + +.fw-annotation:before { + content:"\e6e6"; +} + +.fw-api:before { + content:"\e601"; +} + +.fw-apn:before { + content:"\e602"; +} + +.fw-ios:before { + content:"\e604"; +} + +.fw-application:before { + content:"\e608"; +} + +.fw-arduino:before { + content:"\e6ab"; +} + +.fw-assign:before { + content:"\e6ff"; +} + +.fw-ballerina-service:before { + content:"\e729"; +} + +.fw-ballerina:before { + content:"\e728"; +} + +.fw-bar-chart:before { + content:"\e690"; +} + +.fw-battery:before { + content:"\e60a"; +} + +.fw-blank-document:before { + content:"\e60c"; +} + +.fw-block:before { + content:"\e695"; +} + +.fw-bookmark:before { + content:"\e60d"; +} + +.fw-bpel:before { + content:"\e60e"; +} + +.fw-bpmn:before { + content:"\e60f"; +} + +.fw-break:before { + content:"\e721"; +} + +.fw-bug:before { + content:"\e611"; +} + +.fw-build:before { + content:"\e6c1"; +} + +.fw-calendar:before { + content:"\e612"; +} + +.fw-camera:before { + content:"\e613"; +} + +.fw-cancel:before { + content:"\e618"; +} + +.fw-carbon:before { + content:"\e6c5"; +} + +.fw-chat:before { + content:"\e65b"; +} + +.fw-check:before { + content:"\e617"; +} + +.fw-checklist:before { + content:"\e619"; +} + +.fw-circle-outline:before { + content:"\e61f"; +} + +.fw-circle:before { + content:"\e61a"; +} + +.fw-clear:before { + content:"\e61b"; +} + +.fw-clock:before { + content:"\e61d"; +} + +.fw-cloud:before { + content:"\e61e"; +} + +.fw-code-view:before { + content:"\e70e"; +} + +.fw-code:before { + content:"\e6f1"; +} + +.fw-comment:before { + content:"\e710"; +} + +.fw-compare:before { + content:"\e610"; +} + +.fw-computer:before { + content:"\e653"; +} + +.fw-configarations:before { + content:"\e609"; +} + +.fw-connector:before { + content:"\e700"; +} + +.fw-console:before { + content:"\e71d"; +} + +.fw-constant:before { + content:"\e701"; +} + +.fw-contact:before { + content:"\e620"; +} + +.fw-contract:before { + content:"\e614"; +} + +.fw-copy:before { + content:"\e621"; +} + +.fw-cut:before { + content:"\e6f2"; +} + +.fw-dashboard:before { + content:"\e622"; +} + +.fw-database:before { + content:"\e623"; +} + +.fw-delete:before { + content:"\e624"; +} + +.fw-depend:before { + content:"\e6c6"; +} + +.fw-deploy:before { + content:"\e625"; +} + +.fw-deprecate:before { + content:"\e6cb"; +} + +.fw-design-view:before { + content:"\e70f"; +} + +.fw-devices:before { + content:"\e704"; +} + +.fw-dgm-action-invoke:before { + content:"\e712"; +} + +.fw-dgm-action:before { + content:"\e711"; +} + +.fw-dgm-connector:before { + content:"\e6f4"; +} + +.fw-dgm-constant-definition:before { + content:"\e6f5"; +} + +.fw-dgm-fork:before { + content:"\e6e7"; +} + +.fw-dgm-header:before { + content:"\e6e8"; +} + +.fw-dgm-if-else:before { + content:"\e6e9"; +} + +.fw-dgm-import:before { + content:"\e717"; +} + +.fw-dgm-lifeline:before { + content:"\e6ea"; +} + +.fw-dgm-logger:before { + content:"\e6eb"; +} + +.fw-dgm-resource:before { + content:"\e6f6"; +} + +.fw-dgm-service:before { + content:"\e6f7"; +} + +.fw-dgm-try-catch:before { + content:"\e6ec"; +} + +.fw-dgm-type-convertor:before { + content:"\e6f8"; +} + +.fw-dgm-type:before { + content:"\e6f9"; +} + +.fw-dgm-while:before { + content:"\e707"; +} + +.fw-dial-up:before { + content:"\e627"; +} + +.fw-disabled:before { + content:"\e6d1"; +} + +.fw-display:before { + content:"\e626"; +} + +.fw-docker:before { + content:"\e70c"; +} + +.fw-document:before { + content:"\e628"; +} + +.fw-down-arrow:before { + content:"\e689"; +} + +.fw-down:before { + content:"\e685"; +} + +.fw-download:before { + content:"\e65f"; +} + +.fw-dss:before { + content:"\e62a"; +} + +.fw-ebook:before { + content:"\e62b"; +} + +.fw-edit:before { + content:"\e62c"; +} + +.fw-ellipsis:before { + content:"\e629"; +} + +.fw-endpoint:before { + content:"\e62d"; +} + +.fw-enterprise:before { + content:"\e6b6"; +} + +.fw-error:before { + content:"\e630"; +} + +.fw-esb-connector:before { + content:"\e6e3"; +} + +.fw-expand:before { + content:"\e61c"; +} + +.fw-export:before { + content:"\e631"; +} + +.fw-extensions:before { + content:"\e6e4"; +} + +.fw-facebook:before { + content:"\e6d3"; +} + +.fw-factory-reset:before { + content:"\e632"; +} + +.fw-fan:before { + content:"\e678"; +} + +.fw-faq:before { + content:"\e62f"; +} + +.fw-file-browse:before { + content:"\e633"; +} + +.fw-filter:before { + content:"\e634"; +} + +.fw-folder-open:before { + content:"\e70b"; +} + +.fw-folder:before { + content:"\e62e"; +} + +.fw-fork-join:before { + content:"\e720"; +} + +.fw-format:before { + content:"\e6fa"; +} + +.fw-forum:before { + content:"\e636"; +} + +.fw-function-invoke:before { + content:"\e713"; +} + +.fw-function:before { + content:"\e6fb"; +} + +.fw-gadget:before { + content:"\e637"; +} + +.fw-geo-fence-inbound:before { + content:"\e72e"; +} + +.fw-geo-fence-outbound:before { + content:"\e72f"; +} + +.fw-github:before { + content:"\e6d4"; +} + +.fw-globe:before { + content:"\e697"; +} + +.fw-google-docs:before { + content:"\e6d6"; +} + +.fw-google-drive:before { + content:"\e6da"; +} + +.fw-google-plus:before { + content:"\e6d9"; +} + +.fw-google-sheets:before { + content:"\e6d7"; +} + +.fw-google-slides:before { + content:"\e6d8"; +} + +.fw-google:before { + content:"\e6d5"; +} + +.fw-grid:before { + content:"\e638"; +} + +.fw-grip:before { + content:"\e6b7"; +} + +.fw-group:before { + content:"\e6af"; +} + +.fw-hardware:before { + content:"\e6a9"; +} + +.fw-hdd:before { + content:"\e639"; +} + +.fw-heart:before { + content:"\e6c3"; +} + +.fw-hide:before { + content:"\e6d2"; +} + +.fw-home:before { + content:"\e63a"; +} + +.fw-hour-glass:before { + content:"\e63b"; +} + +.fw-html:before { + content:"\e69d"; +} + +.fw-http:before { + content:"\e705"; +} + +.fw-image:before { + content:"\e70a"; +} + +.fw-import:before { + content:"\e63c"; +} + +.fw-incoming-call:before { + content:"\e63d"; +} + +.fw-info:before { + content:"\e63e"; +} + +.fw-instagram:before { + content:"\e6db"; +} + +.fw-invitation:before { + content:"\e63f"; +} + +.fw-invoke:before { + content:"\e6ed"; +} + +.fw-is-connector:before { + content:"\e6e5"; +} + +.fw-iterate:before { + content:"\e71f"; +} + +.fw-jaggery:before { + content:"\e640"; +} + +.fw-java-spring:before { + content:"\e644"; +} + +.fw-java:before { + content:"\e641"; +} + +.fw-javaee:before { + content:"\e642"; +} + +.fw-javascript:before { + content:"\e643"; +} + +.fw-jaxrs:before { + content:"\e645"; +} + +.fw-jaxws:before { + content:"\e6c7"; +} + +.fw-jquery:before { + content:"\e646"; +} + +.fw-key:before { + content:"\e647"; +} + +.fw-laptop:before { + content:"\e648"; +} + +.fw-layout:before { + content:"\e6bf"; +} + +.fw-ldap:before { + content:"\e649"; +} + +.fw-left-arrow:before { + content:"\e68a"; +} + +.fw-left:before { + content:"\e686"; +} + +.fw-lifecycle:before { + content:"\e64a"; +} + +.fw-light:before { + content:"\e680"; +} + +.fw-linkedin:before { + content:"\e6dc"; +} + +.fw-list-sort:before { + content:"\e64d"; +} + +.fw-list:before { + content:"\e64c"; +} + +.fw-loader:before { + content:"\e6b4"; +} + +.fw-loader2:before { + content:"\e6ba"; +} + +.fw-loader3:before { + content:"\e6bb"; +} + +.fw-loader4:before { + content:"\e6bc"; +} + +.fw-loader5:before { + content:"\e6bd"; +} + +.fw-lock:before { + content:"\e64e"; +} + +.fw-logical:before { + content:"\e702"; +} + +.fw-mail:before { + content:"\e64f"; +} + +.fw-main-function:before { + content:"\e706"; +} + +.fw-map-location:before { + content:"\e650"; +} + +.fw-menu:before { + content:"\e651"; +} + +.fw-message:before { + content:"\e635"; +} + +.fw-micro-services:before { + content:"\e6ce"; +} + +.fw-minus:before, .fw-hyphen:before, .fw-dash:before { + content:"\e616"; +} + +.fw-mobile:before { + content:"\e652"; +} + +.fw-ms-document:before { + content:"\e654"; +} + +.fw-mute:before { + content:"\e655"; +} + +.fw-nodejs:before { + content:"\e656"; +} + +.fw-notification:before { + content:"\e60b"; +} + +.fw-organization:before { + content:"\e6ac"; +} + +.fw-own:before { + content:"\e6c8"; +} + +.fw-package:before { + content:"\e6fd"; +} + +.fw-pages:before { + content:"\e6c0"; +} + +.fw-paste:before { + content:"\e658"; +} + +.fw-pdf:before { + content:"\e659"; +} + +.fw-pending:before { + content:"\e727"; +} + +.fw-php:before { + content:"\e6c9"; +} + +.fw-pie-chart:before { + content:"\e65a"; +} + +.fw-pinterest:before { + content:"\e6dd"; +} + +.fw-policy:before { + content:"\e67d"; +} + +.fw-polygon:before { + content:"\e70d"; +} + +.fw-prototype:before { + content:"\e6cc"; +} + +.fw-proxy:before { + content:"\e699"; +} + +.fw-public:before { + content:"\e6ad"; +} + +.fw-publish:before { + content:"\e65c"; +} + +.fw-question:before { + content:"\e6b0"; +} + +.fw-raspberry:before { + content:"\e6aa"; +} + +.fw-redo:before { + content:"\e65d"; +} + +.fw-refresh:before { + content:"\e692"; +} + +.fw-register:before { + content:"\e65e"; +} + +.fw-rename:before { + content:"\e6fc"; +} + +.fw-reply:before { + content:"\e714"; +} + +.fw-resource:before { + content:"\e660"; +} + +.fw-rest-api:before { + content:"\e661"; +} + +.fw-rest-service:before { + content:"\e662"; +} + +.fw-resume:before { + content:"\e71e"; +} + +.fw-retire:before { + content:"\e6cd"; +} + +.fw-return:before { + content:"\e715"; +} + +.fw-retweet:before { + content:"\e6b9"; +} + +.fw-right-arrow:before { + content:"\e68b"; +} + +.fw-right:before { + content:"\e687"; +} + +.fw-ringing:before { + content:"\e694"; +} + +.fw-rules:before { + content:"\e664"; +} + +.fw-run:before { + content:"\e708"; +} + +.fw-save:before { + content:"\e665"; +} + +.fw-scep:before { + content:"\e666"; +} + +.fw-schema:before { + content:"\e667"; +} + +.fw-search:before { + content:"\e668"; +} + +.fw-security-policy:before { + content:"\e67e"; +} + +.fw-security:before { + content:"\e669"; +} + +.fw-send:before, .fw-paper-rocket:before { + content:"\e66a"; +} + +.fw-sequence:before { + content:"\e66b"; +} + +.fw-server:before { + content:"\e66c"; +} + +.fw-service-provider:before { + content:"\e66e"; +} + +.fw-service:before, .fw-cogwheels:before, .fw-gears:before, .fw-sprockets:before { + content:"\e66d"; +} + +.fw-settings:before, .fw-cogwheel:before, .fw-gear:before, .fw-sprocket:before { + content:"\e66f"; +} + +.fw-share:before { + content:"\e670"; +} + +.fw-shell:before { + content:"\e730"; +} + +.fw-shortcut:before { + content:"\e725"; +} + +.fw-sign-in:before { + content:"\e671"; +} + +.fw-sign-out:before { + content:"\e6b8"; +} + +.fw-skype:before { + content:"\e6de"; +} + +.fw-slash:before { + content:"\e6e1"; +} + +.fw-soap:before { + content:"\e672"; +} + +.fw-sort-down:before { + content:"\e663"; +} + +.fw-sort-up:before { + content:"\e64b"; +} + +.fw-sort:before { + content:"\e673"; +} + +.fw-speed-alert:before { + content:"\e731"; +} + +.fw-square-outline:before { + content:"\e6b2"; +} + +.fw-square:before { + content:"\e6b1"; +} + +.fw-star:before { + content:"\e674"; +} + +.fw-start:before { + content:"\e718"; +} + +.fw-statistics:before { + content:"\e675"; +} + +.fw-stepin:before { + content:"\e719"; +} + +.fw-stepout:before { + content:"\e71a"; +} + +.fw-stepover:before { + content:"\e71b"; +} + +.fw-stop:before { + content:"\e71c"; +} + +.fw-store:before, .fw-cart:before { + content:"\e676"; +} + +.fw-struct:before { + content:"\e716"; +} + +.fw-subscribe:before { + content:"\e677"; +} + +.fw-success:before { + content:"\e657"; +} + +.fw-swagger:before { + content:"\e679"; +} + +.fw-sync:before { + content:"\e6b3"; +} + +.fw-table:before { + content:"\e6c4"; +} + +.fw-tag:before { + content:"\e67a"; +} + +.fw-task:before { + content:"\e67b"; +} + +.fw-text:before { + content:"\e67c"; +} + +.fw-theme:before { + content:"\e726"; +} + +.fw-throttling-policy:before { + content:"\e67f"; +} + +.fw-throw:before { + content:"\e722"; +} + +.fw-tiles:before { + content:"\e681"; +} + +.fw-transaction:before { + content:"\e72b"; +} + +.fw-try-catch:before { + content:"\e703"; +} + +.fw-twitter:before { + content:"\e6df"; +} + +.fw-type-converter:before { + content:"\e6f3"; +} + +.fw-uncheck:before { + content:"\e682"; +} + +.fw-undo:before { + content:"\e683"; +} + +.fw-ungroup:before { + content:"\e6b5"; +} + +.fw-unmute:before { + content:"\e6ae"; +} + +.fw-up-arrow:before { + content:"\e688"; +} + +.fw-up:before { + content:"\e684"; +} + +.fw-upload:before { + content:"\e68c"; +} + +.fw-uri:before { + content:"\e68d"; +} + +.fw-usb-drive:before { + content:"\e68e"; +} + +.fw-use:before { + content:"\e6ca"; +} + +.fw-user:before { + content:"\e68f"; +} + +.fw-variable:before { + content:"\e6ee"; +} + +.fw-view:before { + content:"\e691"; +} + +.fw-vpn:before { + content:"\e603"; +} + +.fw-wadl:before { + content:"\e6a1"; +} + +.fw-war:before { + content:"\e69e"; +} + +.fw-warning:before { + content:"\e693"; +} + +.fw-web-app:before { + content:"\e696"; +} + +.fw-web-clip:before { + content:"\e698"; +} + +.fw-web-service:before { + content:"\e69a"; +} + +.fw-website:before { + content:"\e69b"; +} + +.fw-wifi:before { + content:"\e607"; +} + +.fw-windows:before { + content:"\e605"; +} + +.fw-worker-invoke:before { + content:"\e723"; +} + +.fw-worker-reply:before { + content:"\e724"; +} + +.fw-worker:before { + content:"\e6ef"; +} + +.fw-wsdl:before { + content:"\e6a0"; +} + +.fw-wso2-logo:before { + content:"\e6a7"; +} + +.fw-wso2:before { + content:"\e6a8"; +} + +.fw-xacml:before { + content:"\e69f"; +} + +.fw-xml:before { + content:"\e69c"; +} + +.fw-xq:before { + content:"\e6a2"; +} + +.fw-xsd:before { + content:"\e6a3"; +} + +.fw-xslt:before { + content:"\e6a4"; +} + +.fw-youtube:before { + content:"\e6e0"; +} + +.fw-zoom-in:before { + content:"\e6a5"; +} + +.fw-zoom-out:before { + content:"\e6a6"; +} + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.min.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.min.css index 6c3d742e3b4..8d2a487bef7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.min.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/font-wso2-1.3.0/css/font-wso2.min.css @@ -1,15 +1,15 @@ -/*! -~ Copyright (c) WSO2 Inc. (http://wso2.com) All Rights Reserved. -~ -~ Licensed under the Apache License, Version 2.0 (the "License"); -~ you may not use this file except in compliance with the License. -~ You may obtain a copy of the License at -~ -~ http://www.apache.org/licenses/LICENSE-2.0 -~ -~ Unless required by applicable law or agreed to in writing, software -~ distributed under the License is distributed on an "AS IS" BASIS, -~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -~ See the License for the specific language governing permissions and -~ limitations under the License. -*/.fw-fw,.fw-li{text-align:center}@font-face{font-family:font-wso2;src:local("font-wso2"),url(../fonts/font-wso2.eot?6563fa91278f239ef8c827d90a165223);src:local("font-wso2"),url(../fonts/font-wso2.eot?#iefix) format("embedded-opentype"),url(../fonts/font-wso2.woff2?6563fa91278f239ef8c827d90a165223) format("woff2"),url(../fonts/font-wso2.woff?6563fa91278f239ef8c827d90a165223) format("woff"),url(../fonts/font-wso2.ttf?6563fa91278f239ef8c827d90a165223) format("truetype"),url(../fonts/font-wso2.svg?6563fa91278f239ef8c827d90a165223#font-wso2) format("svg");font-weight:400;font-style:normal}.fw,[class*=" fw-"],[class^=fw-]{font:normal normal normal 14px/1 font-wso2;display:inline-block;font-weight:400;font-style:normal;font-size:inherit;font-variant:normal;speak:none;text-decoration:inherit;text-transform:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fw-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fw-2x{font-size:2em}.fw-3x{font-size:3em}.fw-4x{font-size:4em}.fw-5x{font-size:5em}.fw-fw{width:1.28571429em}.fw-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fw-ul>li{position:relative}.fw-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em}.fw-li.fw-lg{left:-1.85714286em}.fw-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fw-background{background:#888;border-radius:.3em;padding:.4em .5em .45em}.fw-pull-left{float:left}.fw-pull-right{float:right}.fw.fw-pull-left{margin-right:.3em}.fw.fw-pull-right{margin-left:.3em}.fw-spin{-webkit-animation:fw-spin 2s infinite linear;animation:fw-spin 2s infinite linear}@-webkit-keyframes fw-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fw-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fw-pulse{-webkit-animation:fw-pulse 2s ease-out infinite;animation:fw-pulse 2s ease-out infinite}@-webkit-keyframes fw-pulse{0%,100%,30%{opacity:.3}40%{opacity:1}}@keyframes fw-pulse{0%,100%,30%{opacity:.3}40%{opacity:1}}.fw-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fw-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fw-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fw-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fw-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fw-flip-horizontal,:root .fw-flip-vertical,:root .fw-rotate-180,:root .fw-rotate-270,:root .fw-rotate-90{filter:none}.fw-helper,.fw-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:1.85em;vertical-align:middle}.fw-helper:after,.fw-helper:before,.fw-stack-1x,.fw-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fw-helper:before,.fw-stack-1x{line-height:inherit}.fw-helper:after,.fw-stack-2x{font-size:1.9em}.fw-helper-slash:before{font-size:1.4em}.fw-helper-circle:before,.fw-helper-square:before{z-index:1}.fw-helper-circle-outline:after{content:"\e61f"}.fw-helper-circle:after{content:"\e61a"}.fw-helper-square-outline:after{content:"\e6b2"}.fw-helper-square:after{content:"\e6b1"}.fw-helper-slash:after{content:"\e6e1"}.fw-stack>.fw-stack{position:absolute;font-size:.5em}.fw-stack>.fw-stack.fw-move-top{top:-.2em}.fw-stack>.fw-stack.fw-move-bottom{bottom:-.2em}.fw-stack>.fw.stack.fw-move-left{left:-.5em}.fw-stack>.fw-stack.fw-move-right{right:-.5em}.fw-helper-inverse:after,.fw-inverse:before,.fw-number{color:#fff}.fw-helper-shadow:after,.fw-shadow:before{text-shadow:#fff 1px 1px 0}.fw-helper-stroke:after,.fw-stroke:before{text-shadow:-2px -2px 0 #fff,2px -2px 0 #fff,-2px 2px 0 #fff,2px 2px 0 #fff}.fw-number{line-height:2em;font-family:Arial,Helvetica,sans-serif}.fw-abort:before{content:"\e72a"}.fw-action-invoke:before{content:"\e6fe"}.fw-action:before{content:"\e709"}.fw-activate:before{content:"\e6cf"}.fw-add:before{content:"\e615"}.fw-airplay:before{content:"\e600"}.fw-alarm:before{content:"\e6c2"}.fw-alert:before{content:"\e6be"}.fw-analytics-extensions:before{content:"\e6e2"}.fw-android-logcat:before{content:"\e72c"}.fw-android-sense:before{content:"\e72d"}.fw-android:before{content:"\e606"}.fw-annotation:before{content:"\e6e6"}.fw-api:before{content:"\e601"}.fw-apn:before{content:"\e602"}.fw-apple:before{content:"\e604"}.fw-application:before{content:"\e608"}.fw-arduino:before{content:"\e6ab"}.fw-assign:before{content:"\e6ff"}.fw-ballerina-service:before{content:"\e729"}.fw-ballerina:before{content:"\e728"}.fw-bar-chart:before{content:"\e690"}.fw-battery:before{content:"\e60a"}.fw-blank-document:before{content:"\e60c"}.fw-block:before{content:"\e695"}.fw-bookmark:before{content:"\e60d"}.fw-bpel:before{content:"\e60e"}.fw-bpmn:before{content:"\e60f"}.fw-break:before{content:"\e721"}.fw-bug:before{content:"\e611"}.fw-build:before{content:"\e6c1"}.fw-calendar:before{content:"\e612"}.fw-camera:before{content:"\e613"}.fw-cancel:before{content:"\e618"}.fw-carbon:before{content:"\e6c5"}.fw-chat:before{content:"\e65b"}.fw-check:before{content:"\e617"}.fw-checklist:before{content:"\e619"}.fw-circle-outline:before{content:"\e61f"}.fw-circle:before{content:"\e61a"}.fw-clear:before{content:"\e61b"}.fw-clock:before{content:"\e61d"}.fw-cloud:before{content:"\e61e"}.fw-code-view:before{content:"\e70e"}.fw-code:before{content:"\e6f1"}.fw-comment:before{content:"\e710"}.fw-compare:before{content:"\e610"}.fw-computer:before{content:"\e653"}.fw-configarations:before{content:"\e609"}.fw-connector:before{content:"\e700"}.fw-console:before{content:"\e71d"}.fw-constant:before{content:"\e701"}.fw-contact:before{content:"\e620"}.fw-contract:before{content:"\e614"}.fw-copy:before{content:"\e621"}.fw-cut:before{content:"\e6f2"}.fw-dashboard:before{content:"\e622"}.fw-database:before{content:"\e623"}.fw-delete:before{content:"\e624"}.fw-depend:before{content:"\e6c6"}.fw-deploy:before{content:"\e625"}.fw-deprecate:before{content:"\e6cb"}.fw-design-view:before{content:"\e70f"}.fw-devices:before{content:"\e704"}.fw-dgm-action-invoke:before{content:"\e712"}.fw-dgm-action:before{content:"\e711"}.fw-dgm-connector:before{content:"\e6f4"}.fw-dgm-constant-definition:before{content:"\e6f5"}.fw-dgm-fork:before{content:"\e6e7"}.fw-dgm-header:before{content:"\e6e8"}.fw-dgm-if-else:before{content:"\e6e9"}.fw-dgm-import:before{content:"\e717"}.fw-dgm-lifeline:before{content:"\e6ea"}.fw-dgm-logger:before{content:"\e6eb"}.fw-dgm-resource:before{content:"\e6f6"}.fw-dgm-service:before{content:"\e6f7"}.fw-dgm-try-catch:before{content:"\e6ec"}.fw-dgm-type-convertor:before{content:"\e6f8"}.fw-dgm-type:before{content:"\e6f9"}.fw-dgm-while:before{content:"\e707"}.fw-dial-up:before{content:"\e627"}.fw-disabled:before{content:"\e6d1"}.fw-display:before{content:"\e626"}.fw-docker:before{content:"\e70c"}.fw-document:before{content:"\e628"}.fw-down-arrow:before{content:"\e689"}.fw-down:before{content:"\e685"}.fw-download:before{content:"\e65f"}.fw-dss:before{content:"\e62a"}.fw-ebook:before{content:"\e62b"}.fw-edit:before{content:"\e62c"}.fw-ellipsis:before{content:"\e629"}.fw-endpoint:before{content:"\e62d"}.fw-enterprise:before{content:"\e6b6"}.fw-error:before{content:"\e630"}.fw-esb-connector:before{content:"\e6e3"}.fw-expand:before{content:"\e61c"}.fw-export:before{content:"\e631"}.fw-extensions:before{content:"\e6e4"}.fw-facebook:before{content:"\e6d3"}.fw-factory-reset:before{content:"\e632"}.fw-fan:before{content:"\e678"}.fw-faq:before{content:"\e62f"}.fw-file-browse:before{content:"\e633"}.fw-filter:before{content:"\e634"}.fw-folder-open:before{content:"\e70b"}.fw-folder:before{content:"\e62e"}.fw-fork-join:before{content:"\e720"}.fw-format:before{content:"\e6fa"}.fw-forum:before{content:"\e636"}.fw-function-invoke:before{content:"\e713"}.fw-function:before{content:"\e6fb"}.fw-gadget:before{content:"\e637"}.fw-geo-fence-inbound:before{content:"\e72e"}.fw-geo-fence-outbound:before{content:"\e72f"}.fw-github:before{content:"\e6d4"}.fw-globe:before{content:"\e697"}.fw-google-docs:before{content:"\e6d6"}.fw-google-drive:before{content:"\e6da"}.fw-google-plus:before{content:"\e6d9"}.fw-google-sheets:before{content:"\e6d7"}.fw-google-slides:before{content:"\e6d8"}.fw-google:before{content:"\e6d5"}.fw-grid:before{content:"\e638"}.fw-grip:before{content:"\e6b7"}.fw-group:before{content:"\e6af"}.fw-hardware:before{content:"\e6a9"}.fw-hdd:before{content:"\e639"}.fw-heart:before{content:"\e6c3"}.fw-hide:before{content:"\e6d2"}.fw-home:before{content:"\e63a"}.fw-hour-glass:before{content:"\e63b"}.fw-html:before{content:"\e69d"}.fw-http:before{content:"\e705"}.fw-image:before{content:"\e70a"}.fw-import:before{content:"\e63c"}.fw-incoming-call:before{content:"\e63d"}.fw-info:before{content:"\e63e"}.fw-instagram:before{content:"\e6db"}.fw-invitation:before{content:"\e63f"}.fw-invoke:before{content:"\e6ed"}.fw-is-connector:before{content:"\e6e5"}.fw-iterate:before{content:"\e71f"}.fw-jaggery:before{content:"\e640"}.fw-java-spring:before{content:"\e644"}.fw-java:before{content:"\e641"}.fw-javaee:before{content:"\e642"}.fw-javascript:before{content:"\e643"}.fw-jaxrs:before{content:"\e645"}.fw-jaxws:before{content:"\e6c7"}.fw-jquery:before{content:"\e646"}.fw-key:before{content:"\e647"}.fw-laptop:before{content:"\e648"}.fw-layout:before{content:"\e6bf"}.fw-ldap:before{content:"\e649"}.fw-left-arrow:before{content:"\e68a"}.fw-left:before{content:"\e686"}.fw-lifecycle:before{content:"\e64a"}.fw-light:before{content:"\e680"}.fw-linkedin:before{content:"\e6dc"}.fw-list-sort:before{content:"\e64d"}.fw-list:before{content:"\e64c"}.fw-loader:before{content:"\e6b4"}.fw-loader2:before{content:"\e6ba"}.fw-loader3:before{content:"\e6bb"}.fw-loader4:before{content:"\e6bc"}.fw-loader5:before{content:"\e6bd"}.fw-lock:before{content:"\e64e"}.fw-logical:before{content:"\e702"}.fw-mail:before{content:"\e64f"}.fw-main-function:before{content:"\e706"}.fw-map-location:before{content:"\e650"}.fw-menu:before{content:"\e651"}.fw-message:before{content:"\e635"}.fw-micro-services:before{content:"\e6ce"}.fw-dash:before,.fw-hyphen:before,.fw-minus:before{content:"\e616"}.fw-mobile:before{content:"\e652"}.fw-ms-document:before{content:"\e654"}.fw-mute:before{content:"\e655"}.fw-nodejs:before{content:"\e656"}.fw-notification:before{content:"\e60b"}.fw-organization:before{content:"\e6ac"}.fw-own:before{content:"\e6c8"}.fw-package:before{content:"\e6fd"}.fw-pages:before{content:"\e6c0"}.fw-paste:before{content:"\e658"}.fw-pdf:before{content:"\e659"}.fw-pending:before{content:"\e727"}.fw-php:before{content:"\e6c9"}.fw-pie-chart:before{content:"\e65a"}.fw-pinterest:before{content:"\e6dd"}.fw-policy:before{content:"\e67d"}.fw-polygon:before{content:"\e70d"}.fw-prototype:before{content:"\e6cc"}.fw-proxy:before{content:"\e699"}.fw-public:before{content:"\e6ad"}.fw-publish:before{content:"\e65c"}.fw-question:before{content:"\e6b0"}.fw-raspberry:before{content:"\e6aa"}.fw-redo:before{content:"\e65d"}.fw-refresh:before{content:"\e692"}.fw-register:before{content:"\e65e"}.fw-rename:before{content:"\e6fc"}.fw-reply:before{content:"\e714"}.fw-resource:before{content:"\e660"}.fw-rest-api:before{content:"\e661"}.fw-rest-service:before{content:"\e662"}.fw-resume:before{content:"\e71e"}.fw-retire:before{content:"\e6cd"}.fw-return:before{content:"\e715"}.fw-retweet:before{content:"\e6b9"}.fw-right-arrow:before{content:"\e68b"}.fw-right:before{content:"\e687"}.fw-ringing:before{content:"\e694"}.fw-rules:before{content:"\e664"}.fw-run:before{content:"\e708"}.fw-save:before{content:"\e665"}.fw-scep:before{content:"\e666"}.fw-schema:before{content:"\e667"}.fw-search:before{content:"\e668"}.fw-security-policy:before{content:"\e67e"}.fw-security:before{content:"\e669"}.fw-paper-rocket:before,.fw-send:before{content:"\e66a"}.fw-sequence:before{content:"\e66b"}.fw-server:before{content:"\e66c"}.fw-service-provider:before{content:"\e66e"}.fw-cogwheels:before,.fw-gears:before,.fw-service:before,.fw-sprockets:before{content:"\e66d"}.fw-cogwheel:before,.fw-gear:before,.fw-settings:before,.fw-sprocket:before{content:"\e66f"}.fw-share:before{content:"\e670"}.fw-shell:before{content:"\e730"}.fw-shortcut:before{content:"\e725"}.fw-sign-in:before{content:"\e671"}.fw-sign-out:before{content:"\e6b8"}.fw-skype:before{content:"\e6de"}.fw-slash:before{content:"\e6e1"}.fw-soap:before{content:"\e672"}.fw-sort-down:before{content:"\e663"}.fw-sort-up:before{content:"\e64b"}.fw-sort:before{content:"\e673"}.fw-speed-alert:before{content:"\e731"}.fw-square-outline:before{content:"\e6b2"}.fw-square:before{content:"\e6b1"}.fw-star:before{content:"\e674"}.fw-start:before{content:"\e718"}.fw-statistics:before{content:"\e675"}.fw-stepin:before{content:"\e719"}.fw-stepout:before{content:"\e71a"}.fw-stepover:before{content:"\e71b"}.fw-stop:before{content:"\e71c"}.fw-cart:before,.fw-store:before{content:"\e676"}.fw-struct:before{content:"\e716"}.fw-subscribe:before{content:"\e677"}.fw-success:before{content:"\e657"}.fw-swagger:before{content:"\e679"}.fw-sync:before{content:"\e6b3"}.fw-table:before{content:"\e6c4"}.fw-tag:before{content:"\e67a"}.fw-task:before{content:"\e67b"}.fw-text:before{content:"\e67c"}.fw-theme:before{content:"\e726"}.fw-throttling-policy:before{content:"\e67f"}.fw-throw:before{content:"\e722"}.fw-tiles:before{content:"\e681"}.fw-transaction:before{content:"\e72b"}.fw-try-catch:before{content:"\e703"}.fw-twitter:before{content:"\e6df"}.fw-type-converter:before{content:"\e6f3"}.fw-uncheck:before{content:"\e682"}.fw-undo:before{content:"\e683"}.fw-ungroup:before{content:"\e6b5"}.fw-unmute:before{content:"\e6ae"}.fw-up-arrow:before{content:"\e688"}.fw-up:before{content:"\e684"}.fw-upload:before{content:"\e68c"}.fw-uri:before{content:"\e68d"}.fw-usb-drive:before{content:"\e68e"}.fw-use:before{content:"\e6ca"}.fw-user:before{content:"\e68f"}.fw-variable:before{content:"\e6ee"}.fw-view:before{content:"\e691"}.fw-vpn:before{content:"\e603"}.fw-wadl:before{content:"\e6a1"}.fw-war:before{content:"\e69e"}.fw-warning:before{content:"\e693"}.fw-web-app:before{content:"\e696"}.fw-web-clip:before{content:"\e698"}.fw-web-service:before{content:"\e69a"}.fw-website:before{content:"\e69b"}.fw-wifi:before{content:"\e607"}.fw-windows:before{content:"\e605"}.fw-worker-invoke:before{content:"\e723"}.fw-worker-reply:before{content:"\e724"}.fw-worker:before{content:"\e6ef"}.fw-wsdl:before{content:"\e6a0"}.fw-wso2-logo:before{content:"\e6a7"}.fw-wso2:before{content:"\e6a8"}.fw-xacml:before{content:"\e69f"}.fw-xml:before{content:"\e69c"}.fw-xq:before{content:"\e6a2"}.fw-xsd:before{content:"\e6a3"}.fw-xslt:before{content:"\e6a4"}.fw-youtube:before{content:"\e6e0"}.fw-zoom-in:before{content:"\e6a5"}.fw-zoom-out:before{content:"\e6a6"} \ No newline at end of file +/*! +~ Copyright (c) WSO2 Inc. (http://wso2.com) All Rights Reserved. +~ +~ Licensed under the Apache License, Version 2.0 (the "License"); +~ you may not use this file except in compliance with the License. +~ You may obtain a copy of the License at +~ +~ http://www.apache.org/licenses/LICENSE-2.0 +~ +~ Unless required by applicable law or agreed to in writing, software +~ distributed under the License is distributed on an "AS IS" BASIS, +~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~ See the License for the specific language governing permissions and +~ limitations under the License. +*/.fw-fw,.fw-li{text-align:center}@font-face{font-family:font-wso2;src:local("font-wso2"),url(../fonts/font-wso2.eot?6563fa91278f239ef8c827d90a165223);src:local("font-wso2"),url(../fonts/font-wso2.eot?#iefix) format("embedded-opentype"),url(../fonts/font-wso2.woff2?6563fa91278f239ef8c827d90a165223) format("woff2"),url(../fonts/font-wso2.woff?6563fa91278f239ef8c827d90a165223) format("woff"),url(../fonts/font-wso2.ttf?6563fa91278f239ef8c827d90a165223) format("truetype"),url(../fonts/font-wso2.svg?6563fa91278f239ef8c827d90a165223#font-wso2) format("svg");font-weight:400;font-style:normal}.fw,[class*=" fw-"],[class^=fw-]{font:normal normal normal 14px/1 font-wso2;display:inline-block;font-weight:400;font-style:normal;font-size:inherit;font-variant:normal;speak:none;text-decoration:inherit;text-transform:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fw-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fw-2x{font-size:2em}.fw-3x{font-size:3em}.fw-4x{font-size:4em}.fw-5x{font-size:5em}.fw-fw{width:1.28571429em}.fw-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fw-ul>li{position:relative}.fw-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em}.fw-li.fw-lg{left:-1.85714286em}.fw-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fw-background{background:#888;border-radius:.3em;padding:.4em .5em .45em}.fw-pull-left{float:left}.fw-pull-right{float:right}.fw.fw-pull-left{margin-right:.3em}.fw.fw-pull-right{margin-left:.3em}.fw-spin{-webkit-animation:fw-spin 2s infinite linear;animation:fw-spin 2s infinite linear}@-webkit-keyframes fw-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fw-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fw-pulse{-webkit-animation:fw-pulse 2s ease-out infinite;animation:fw-pulse 2s ease-out infinite}@-webkit-keyframes fw-pulse{0%,100%,30%{opacity:.3}40%{opacity:1}}@keyframes fw-pulse{0%,100%,30%{opacity:.3}40%{opacity:1}}.fw-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fw-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fw-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fw-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fw-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fw-flip-horizontal,:root .fw-flip-vertical,:root .fw-rotate-180,:root .fw-rotate-270,:root .fw-rotate-90{filter:none}.fw-helper,.fw-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:1.85em;vertical-align:middle}.fw-helper:after,.fw-helper:before,.fw-stack-1x,.fw-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fw-helper:before,.fw-stack-1x{line-height:inherit}.fw-helper:after,.fw-stack-2x{font-size:1.9em}.fw-helper-slash:before{font-size:1.4em}.fw-helper-circle:before,.fw-helper-square:before{z-index:1}.fw-helper-circle-outline:after{content:"\e61f"}.fw-helper-circle:after{content:"\e61a"}.fw-helper-square-outline:after{content:"\e6b2"}.fw-helper-square:after{content:"\e6b1"}.fw-helper-slash:after{content:"\e6e1"}.fw-stack>.fw-stack{position:absolute;font-size:.5em}.fw-stack>.fw-stack.fw-move-top{top:-.2em}.fw-stack>.fw-stack.fw-move-bottom{bottom:-.2em}.fw-stack>.fw.stack.fw-move-left{left:-.5em}.fw-stack>.fw-stack.fw-move-right{right:-.5em}.fw-helper-inverse:after,.fw-inverse:before,.fw-number{color:#fff}.fw-helper-shadow:after,.fw-shadow:before{text-shadow:#fff 1px 1px 0}.fw-helper-stroke:after,.fw-stroke:before{text-shadow:-2px -2px 0 #fff,2px -2px 0 #fff,-2px 2px 0 #fff,2px 2px 0 #fff}.fw-number{line-height:2em;font-family:Arial,Helvetica,sans-serif}.fw-abort:before{content:"\e72a"}.fw-action-invoke:before{content:"\e6fe"}.fw-action:before{content:"\e709"}.fw-activate:before{content:"\e6cf"}.fw-add:before{content:"\e615"}.fw-airplay:before{content:"\e600"}.fw-alarm:before{content:"\e6c2"}.fw-alert:before{content:"\e6be"}.fw-analytics-extensions:before{content:"\e6e2"}.fw-android-logcat:before{content:"\e72c"}.fw-android-sense:before{content:"\e72d"}.fw-android:before{content:"\e606"}.fw-annotation:before{content:"\e6e6"}.fw-api:before{content:"\e601"}.fw-apn:before{content:"\e602"}.fw-ios:before{content:"\e604"}.fw-application:before{content:"\e608"}.fw-arduino:before{content:"\e6ab"}.fw-assign:before{content:"\e6ff"}.fw-ballerina-service:before{content:"\e729"}.fw-ballerina:before{content:"\e728"}.fw-bar-chart:before{content:"\e690"}.fw-battery:before{content:"\e60a"}.fw-blank-document:before{content:"\e60c"}.fw-block:before{content:"\e695"}.fw-bookmark:before{content:"\e60d"}.fw-bpel:before{content:"\e60e"}.fw-bpmn:before{content:"\e60f"}.fw-break:before{content:"\e721"}.fw-bug:before{content:"\e611"}.fw-build:before{content:"\e6c1"}.fw-calendar:before{content:"\e612"}.fw-camera:before{content:"\e613"}.fw-cancel:before{content:"\e618"}.fw-carbon:before{content:"\e6c5"}.fw-chat:before{content:"\e65b"}.fw-check:before{content:"\e617"}.fw-checklist:before{content:"\e619"}.fw-circle-outline:before{content:"\e61f"}.fw-circle:before{content:"\e61a"}.fw-clear:before{content:"\e61b"}.fw-clock:before{content:"\e61d"}.fw-cloud:before{content:"\e61e"}.fw-code-view:before{content:"\e70e"}.fw-code:before{content:"\e6f1"}.fw-comment:before{content:"\e710"}.fw-compare:before{content:"\e610"}.fw-computer:before{content:"\e653"}.fw-configarations:before{content:"\e609"}.fw-connector:before{content:"\e700"}.fw-console:before{content:"\e71d"}.fw-constant:before{content:"\e701"}.fw-contact:before{content:"\e620"}.fw-contract:before{content:"\e614"}.fw-copy:before{content:"\e621"}.fw-cut:before{content:"\e6f2"}.fw-dashboard:before{content:"\e622"}.fw-database:before{content:"\e623"}.fw-delete:before{content:"\e624"}.fw-depend:before{content:"\e6c6"}.fw-deploy:before{content:"\e625"}.fw-deprecate:before{content:"\e6cb"}.fw-design-view:before{content:"\e70f"}.fw-devices:before{content:"\e704"}.fw-dgm-action-invoke:before{content:"\e712"}.fw-dgm-action:before{content:"\e711"}.fw-dgm-connector:before{content:"\e6f4"}.fw-dgm-constant-definition:before{content:"\e6f5"}.fw-dgm-fork:before{content:"\e6e7"}.fw-dgm-header:before{content:"\e6e8"}.fw-dgm-if-else:before{content:"\e6e9"}.fw-dgm-import:before{content:"\e717"}.fw-dgm-lifeline:before{content:"\e6ea"}.fw-dgm-logger:before{content:"\e6eb"}.fw-dgm-resource:before{content:"\e6f6"}.fw-dgm-service:before{content:"\e6f7"}.fw-dgm-try-catch:before{content:"\e6ec"}.fw-dgm-type-convertor:before{content:"\e6f8"}.fw-dgm-type:before{content:"\e6f9"}.fw-dgm-while:before{content:"\e707"}.fw-dial-up:before{content:"\e627"}.fw-disabled:before{content:"\e6d1"}.fw-display:before{content:"\e626"}.fw-docker:before{content:"\e70c"}.fw-document:before{content:"\e628"}.fw-down-arrow:before{content:"\e689"}.fw-down:before{content:"\e685"}.fw-download:before{content:"\e65f"}.fw-dss:before{content:"\e62a"}.fw-ebook:before{content:"\e62b"}.fw-edit:before{content:"\e62c"}.fw-ellipsis:before{content:"\e629"}.fw-endpoint:before{content:"\e62d"}.fw-enterprise:before{content:"\e6b6"}.fw-error:before{content:"\e630"}.fw-esb-connector:before{content:"\e6e3"}.fw-expand:before{content:"\e61c"}.fw-export:before{content:"\e631"}.fw-extensions:before{content:"\e6e4"}.fw-facebook:before{content:"\e6d3"}.fw-factory-reset:before{content:"\e632"}.fw-fan:before{content:"\e678"}.fw-faq:before{content:"\e62f"}.fw-file-browse:before{content:"\e633"}.fw-filter:before{content:"\e634"}.fw-folder-open:before{content:"\e70b"}.fw-folder:before{content:"\e62e"}.fw-fork-join:before{content:"\e720"}.fw-format:before{content:"\e6fa"}.fw-forum:before{content:"\e636"}.fw-function-invoke:before{content:"\e713"}.fw-function:before{content:"\e6fb"}.fw-gadget:before{content:"\e637"}.fw-geo-fence-inbound:before{content:"\e72e"}.fw-geo-fence-outbound:before{content:"\e72f"}.fw-github:before{content:"\e6d4"}.fw-globe:before{content:"\e697"}.fw-google-docs:before{content:"\e6d6"}.fw-google-drive:before{content:"\e6da"}.fw-google-plus:before{content:"\e6d9"}.fw-google-sheets:before{content:"\e6d7"}.fw-google-slides:before{content:"\e6d8"}.fw-google:before{content:"\e6d5"}.fw-grid:before{content:"\e638"}.fw-grip:before{content:"\e6b7"}.fw-group:before{content:"\e6af"}.fw-hardware:before{content:"\e6a9"}.fw-hdd:before{content:"\e639"}.fw-heart:before{content:"\e6c3"}.fw-hide:before{content:"\e6d2"}.fw-home:before{content:"\e63a"}.fw-hour-glass:before{content:"\e63b"}.fw-html:before{content:"\e69d"}.fw-http:before{content:"\e705"}.fw-image:before{content:"\e70a"}.fw-import:before{content:"\e63c"}.fw-incoming-call:before{content:"\e63d"}.fw-info:before{content:"\e63e"}.fw-instagram:before{content:"\e6db"}.fw-invitation:before{content:"\e63f"}.fw-invoke:before{content:"\e6ed"}.fw-is-connector:before{content:"\e6e5"}.fw-iterate:before{content:"\e71f"}.fw-jaggery:before{content:"\e640"}.fw-java-spring:before{content:"\e644"}.fw-java:before{content:"\e641"}.fw-javaee:before{content:"\e642"}.fw-javascript:before{content:"\e643"}.fw-jaxrs:before{content:"\e645"}.fw-jaxws:before{content:"\e6c7"}.fw-jquery:before{content:"\e646"}.fw-key:before{content:"\e647"}.fw-laptop:before{content:"\e648"}.fw-layout:before{content:"\e6bf"}.fw-ldap:before{content:"\e649"}.fw-left-arrow:before{content:"\e68a"}.fw-left:before{content:"\e686"}.fw-lifecycle:before{content:"\e64a"}.fw-light:before{content:"\e680"}.fw-linkedin:before{content:"\e6dc"}.fw-list-sort:before{content:"\e64d"}.fw-list:before{content:"\e64c"}.fw-loader:before{content:"\e6b4"}.fw-loader2:before{content:"\e6ba"}.fw-loader3:before{content:"\e6bb"}.fw-loader4:before{content:"\e6bc"}.fw-loader5:before{content:"\e6bd"}.fw-lock:before{content:"\e64e"}.fw-logical:before{content:"\e702"}.fw-mail:before{content:"\e64f"}.fw-main-function:before{content:"\e706"}.fw-map-location:before{content:"\e650"}.fw-menu:before{content:"\e651"}.fw-message:before{content:"\e635"}.fw-micro-services:before{content:"\e6ce"}.fw-dash:before,.fw-hyphen:before,.fw-minus:before{content:"\e616"}.fw-mobile:before{content:"\e652"}.fw-ms-document:before{content:"\e654"}.fw-mute:before{content:"\e655"}.fw-nodejs:before{content:"\e656"}.fw-notification:before{content:"\e60b"}.fw-organization:before{content:"\e6ac"}.fw-own:before{content:"\e6c8"}.fw-package:before{content:"\e6fd"}.fw-pages:before{content:"\e6c0"}.fw-paste:before{content:"\e658"}.fw-pdf:before{content:"\e659"}.fw-pending:before{content:"\e727"}.fw-php:before{content:"\e6c9"}.fw-pie-chart:before{content:"\e65a"}.fw-pinterest:before{content:"\e6dd"}.fw-policy:before{content:"\e67d"}.fw-polygon:before{content:"\e70d"}.fw-prototype:before{content:"\e6cc"}.fw-proxy:before{content:"\e699"}.fw-public:before{content:"\e6ad"}.fw-publish:before{content:"\e65c"}.fw-question:before{content:"\e6b0"}.fw-raspberry:before{content:"\e6aa"}.fw-redo:before{content:"\e65d"}.fw-refresh:before{content:"\e692"}.fw-register:before{content:"\e65e"}.fw-rename:before{content:"\e6fc"}.fw-reply:before{content:"\e714"}.fw-resource:before{content:"\e660"}.fw-rest-api:before{content:"\e661"}.fw-rest-service:before{content:"\e662"}.fw-resume:before{content:"\e71e"}.fw-retire:before{content:"\e6cd"}.fw-return:before{content:"\e715"}.fw-retweet:before{content:"\e6b9"}.fw-right-arrow:before{content:"\e68b"}.fw-right:before{content:"\e687"}.fw-ringing:before{content:"\e694"}.fw-rules:before{content:"\e664"}.fw-run:before{content:"\e708"}.fw-save:before{content:"\e665"}.fw-scep:before{content:"\e666"}.fw-schema:before{content:"\e667"}.fw-search:before{content:"\e668"}.fw-security-policy:before{content:"\e67e"}.fw-security:before{content:"\e669"}.fw-paper-rocket:before,.fw-send:before{content:"\e66a"}.fw-sequence:before{content:"\e66b"}.fw-server:before{content:"\e66c"}.fw-service-provider:before{content:"\e66e"}.fw-cogwheels:before,.fw-gears:before,.fw-service:before,.fw-sprockets:before{content:"\e66d"}.fw-cogwheel:before,.fw-gear:before,.fw-settings:before,.fw-sprocket:before{content:"\e66f"}.fw-share:before{content:"\e670"}.fw-shell:before{content:"\e730"}.fw-shortcut:before{content:"\e725"}.fw-sign-in:before{content:"\e671"}.fw-sign-out:before{content:"\e6b8"}.fw-skype:before{content:"\e6de"}.fw-slash:before{content:"\e6e1"}.fw-soap:before{content:"\e672"}.fw-sort-down:before{content:"\e663"}.fw-sort-up:before{content:"\e64b"}.fw-sort:before{content:"\e673"}.fw-speed-alert:before{content:"\e731"}.fw-square-outline:before{content:"\e6b2"}.fw-square:before{content:"\e6b1"}.fw-star:before{content:"\e674"}.fw-start:before{content:"\e718"}.fw-statistics:before{content:"\e675"}.fw-stepin:before{content:"\e719"}.fw-stepout:before{content:"\e71a"}.fw-stepover:before{content:"\e71b"}.fw-stop:before{content:"\e71c"}.fw-cart:before,.fw-store:before{content:"\e676"}.fw-struct:before{content:"\e716"}.fw-subscribe:before{content:"\e677"}.fw-success:before{content:"\e657"}.fw-swagger:before{content:"\e679"}.fw-sync:before{content:"\e6b3"}.fw-table:before{content:"\e6c4"}.fw-tag:before{content:"\e67a"}.fw-task:before{content:"\e67b"}.fw-text:before{content:"\e67c"}.fw-theme:before{content:"\e726"}.fw-throttling-policy:before{content:"\e67f"}.fw-throw:before{content:"\e722"}.fw-tiles:before{content:"\e681"}.fw-transaction:before{content:"\e72b"}.fw-try-catch:before{content:"\e703"}.fw-twitter:before{content:"\e6df"}.fw-type-converter:before{content:"\e6f3"}.fw-uncheck:before{content:"\e682"}.fw-undo:before{content:"\e683"}.fw-ungroup:before{content:"\e6b5"}.fw-unmute:before{content:"\e6ae"}.fw-up-arrow:before{content:"\e688"}.fw-up:before{content:"\e684"}.fw-upload:before{content:"\e68c"}.fw-uri:before{content:"\e68d"}.fw-usb-drive:before{content:"\e68e"}.fw-use:before{content:"\e6ca"}.fw-user:before{content:"\e68f"}.fw-variable:before{content:"\e6ee"}.fw-view:before{content:"\e691"}.fw-vpn:before{content:"\e603"}.fw-wadl:before{content:"\e6a1"}.fw-war:before{content:"\e69e"}.fw-warning:before{content:"\e693"}.fw-web-app:before{content:"\e696"}.fw-web-clip:before{content:"\e698"}.fw-web-service:before{content:"\e69a"}.fw-website:before{content:"\e69b"}.fw-wifi:before{content:"\e607"}.fw-windows:before{content:"\e605"}.fw-worker-invoke:before{content:"\e723"}.fw-worker-reply:before{content:"\e724"}.fw-worker:before{content:"\e6ef"}.fw-wsdl:before{content:"\e6a0"}.fw-wso2-logo:before{content:"\e6a7"}.fw-wso2:before{content:"\e6a8"}.fw-xacml:before{content:"\e69f"}.fw-xml:before{content:"\e69c"}.fw-xq:before{content:"\e6a2"}.fw-xsd:before{content:"\e6a3"}.fw-xslt:before{content:"\e6a4"}.fw-youtube:before{content:"\e6e0"}.fw-zoom-in:before{content:"\e6a5"}.fw-zoom-out:before{content:"\e6a6"} \ No newline at end of file From 3565e03c1b0cfaadbb2936597eb4fb319ea4c9c9 Mon Sep 17 00:00:00 2001 From: charitha Date: Wed, 17 Apr 2019 09:21:27 +0530 Subject: [PATCH 03/27] Fix test cases --- .../impl/DeviceManagementServiceImpl.java | 17 ++++--- .../impl/DeviceTypeManagementServiceImpl.java | 16 ++++--- .../impl/DeviceManagementServiceImplTest.java | 18 ++------ .../DeviceTypeManagementAdminServiceTest.java | 8 ++-- .../impl/DeviceTypeManagementServiceTest.java | 13 +++--- .../common/DeviceTypeNotFoundException.java | 44 +++++++++++++++++++ .../DeviceManagementProviderService.java | 2 +- .../DeviceManagementProviderServiceImpl.java | 5 ++- .../impl/DeviceManagementServiceImpl.java | 10 ++++- .../impl/DeviceTypeManagementServiceImpl.java | 12 ++++- .../impl/DeviceManagementServiceImplTest.java | 10 ++--- 11 files changed, 109 insertions(+), 46 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceTypeNotFoundException.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 10aa8538fa8..5c69f0bd4d4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -25,6 +25,7 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; @@ -506,18 +507,22 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @PathParam("type") @Size(max = 45) String type, @PathParam("id") @Size(max = 45) String id, @HeaderParam("If-Modified-Since") String ifModifiedSince) { - List features; + List features = new ArrayList<>(); DeviceManagementProviderService dms; try { RequestValidationUtil.validateDeviceIdentifier(type, id); dms = DeviceMgtAPIUtils.getDeviceManagementService(); - FeatureManager fm = dms.getFeatureManager(type); - if (fm == null) { + FeatureManager fm; + try { + fm = dms.getFeatureManager(type); + } catch (DeviceTypeNotFoundException e) { return Response.status(Response.Status.NOT_FOUND).entity( - new ErrorResponse.ErrorResponseBuilder().setMessage("No feature manager is " + - "registered with the given type '" + type + "'").build()).build(); + new ErrorResponse.ErrorResponseBuilder() + .setMessage("No device type found with name '" + type + "'").build()).build(); + } + if (fm != null) { + features = fm.getFeatures(); } - features = fm.getFeatures(); } catch (DeviceManagementException e) { String msg = "Error occurred while retrieving the list of features of '" + type + "' device, which " + "carries the id '" + id + "'"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java index b20b3462de4..e9129c4c6eb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java @@ -38,6 +38,7 @@ package org.wso2.carbon.device.mgt.jaxrs.service.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; @@ -107,14 +108,19 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ @Path("/{type}/features") public Response getFeatures(@PathParam("type") @Size(max = 45) String type, @HeaderParam("If-Modified-Since") String ifModifiedSince) { - List features; + List features = new ArrayList<>(); DeviceManagementProviderService dms; try { dms = DeviceMgtAPIUtils.getDeviceManagementService(); - FeatureManager fm = dms.getFeatureManager(type); - if (fm == null) { - features = new ArrayList<>(); - } else { + FeatureManager fm; + try { + fm = dms.getFeatureManager(type); + } catch (DeviceTypeNotFoundException e) { + return Response.status(Response.Status.NOT_FOUND).entity( + new ErrorResponse.ErrorResponseBuilder() + .setMessage("No device type found with name '" + type + "'").build()).build(); + } + if (fm != null) { features = fm.getFeatures(); } } catch (DeviceManagementException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java index c8549711fc2..51aeaabde64 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java @@ -34,6 +34,7 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; @@ -437,26 +438,15 @@ public class DeviceManagementServiceImplTest { Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); } - @Test(description = "Testing getting device features when feature manager is not registered for the device type") - public void testGetFeaturesOfDeviceWhenFeatureManagerIsNotRegistered() throws DeviceManagementException { - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) - .toReturn(this.deviceManagementProviderService); - Mockito.when(this.deviceManagementProviderService.getFeatureManager(Mockito.anyString())).thenReturn(null); - Response response = this.deviceManagementService - .getFeaturesOfDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString(), null); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - Mockito.reset(this.deviceManagementProviderService); - } - @Test(description = "Testing getting device features when unable to get the feature manager") - public void testGetFeaturesException() throws DeviceManagementException { + public void testGetFeaturesException() throws DeviceTypeNotFoundException { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); Mockito.when(this.deviceManagementProviderService.getFeatureManager(Mockito.anyString())) - .thenThrow(new DeviceManagementException()); + .thenThrow(new DeviceTypeNotFoundException()); Response response = this.deviceManagementService .getFeaturesOfDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString(), null); - Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); + Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); Mockito.reset(this.deviceManagementProviderService); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java index 0d275ea52d8..1b8910507db 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java @@ -171,7 +171,7 @@ public class DeviceTypeManagementAdminServiceTest { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceTypeGeneratorService")) .toReturn(this.deviceTypeGeneratorService); DeviceType deviceType = DeviceMgtAPITestHelper.getDummyDeviceType(TEST_DEVICE_TYPE, TEST_DEVICE_TYPE_ID); - Response response = this.deviceTypeManagementAdminService.updateDeviceType(deviceType); + Response response = this.deviceTypeManagementAdminService.updateDeviceType(TEST_DEVICE_TYPE, deviceType); Assert.assertNotNull(response, "The response should not be null"); Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(), "The Response Status code should be 200."); @@ -185,7 +185,7 @@ public class DeviceTypeManagementAdminServiceTest { .toReturn(this.deviceTypeGeneratorService); Mockito.when(deviceManagementProviderService.getDeviceType(Mockito.anyString())).thenReturn(null); DeviceType deviceType = DeviceMgtAPITestHelper.getDummyDeviceType(TEST_DEVICE_TYPE, TEST_DEVICE_TYPE_ID); - Response response = this.deviceTypeManagementAdminService.updateDeviceType(deviceType); + Response response = this.deviceTypeManagementAdminService.updateDeviceType(TEST_DEVICE_TYPE, deviceType); Assert.assertNotNull(response, "The response should not be null"); Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode(), "The Response Status code should be 400."); @@ -196,7 +196,7 @@ public class DeviceTypeManagementAdminServiceTest { public void testUpdateDeviceTypeWithNullDeviceType() { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); - Response response = this.deviceTypeManagementAdminService.updateDeviceType(null); + Response response = this.deviceTypeManagementAdminService.updateDeviceType(TEST_DEVICE_TYPE, null); Assert.assertNotNull(response, "The response should not be null"); Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode(), "The Response Status code should be 400."); @@ -210,7 +210,7 @@ public class DeviceTypeManagementAdminServiceTest { Mockito.when(this.deviceManagementProviderService.getDeviceType(Mockito.anyString())) .thenThrow(new DeviceManagementException()); DeviceType deviceType = DeviceMgtAPITestHelper.getDummyDeviceType(TEST_DEVICE_TYPE, TEST_DEVICE_TYPE_ID); - Response response = this.deviceTypeManagementAdminService.updateDeviceType(deviceType); + Response response = this.deviceTypeManagementAdminService.updateDeviceType(TEST_DEVICE_TYPE, deviceType); Assert.assertNotNull(response, "The response should not be null"); Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "The Response Status code should be 500."); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java index 9629afb07ab..7143108184b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java @@ -89,7 +89,7 @@ public class DeviceTypeManagementServiceTest { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); Mockito.when(this.deviceManagementProviderService.getDeviceTypes()).thenThrow(new DeviceManagementException()); - Response response = this.deviceTypeManagementService.getDeviceTypes(); + Response response = this.deviceTypeManagementService.getDeviceTypes(MODIFIED_SINCE); Assert.assertNotNull(response, "The response object is null."); Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "The response status should be 500."); @@ -100,7 +100,7 @@ public class DeviceTypeManagementServiceTest { public void testExistingDeviceTypesModifiedError() throws Exception { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); - Mockito.when(this.deviceManagementProviderService.getAvailableDeviceTypes()).thenThrow(new + Mockito.when(this.deviceManagementProviderService.getDeviceTypes()).thenThrow(new DeviceManagementException()); Response response = this.deviceTypeManagementService.getDeviceTypes(MODIFIED_SINCE); Assert.assertNotNull(response, "The response object is null."); @@ -142,8 +142,9 @@ public class DeviceTypeManagementServiceTest { Mockito.when(this.deviceManagementProviderService.getFeatureManager(Mockito.anyString())).thenReturn(null); Response response = this.deviceTypeManagementService.getFeatures(TEST_DEVICE_TYPE, MODIFIED_SINCE); Assert.assertNotNull(response, "The response object is null."); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode(), - "The response status should be 404."); + Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(), + "The response status should be 200."); + Assert.assertEquals(response.getEntity().toString(), "[]", "The response should be []."); Mockito.reset(deviceManagementProviderService); } @@ -151,7 +152,7 @@ public class DeviceTypeManagementServiceTest { public void testGetDeviceTypes() throws Exception { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); - Response response = this.deviceTypeManagementService.getDeviceTypes(); + Response response = this.deviceTypeManagementService.getDeviceTypes(MODIFIED_SINCE); Assert.assertNotNull(response, "The response object is null."); Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(), "The response status should be 200."); @@ -163,7 +164,7 @@ public class DeviceTypeManagementServiceTest { .toReturn(this.deviceManagementProviderService); List deviceTypes = DeviceMgtAPITestHelper.getDummyDeviceTypeList(5); Mockito.when(this.deviceManagementProviderService.getDeviceTypes()).thenReturn(deviceTypes); - Response response = this.deviceTypeManagementService.getDeviceTypes(); + Response response = this.deviceTypeManagementService.getDeviceTypes(MODIFIED_SINCE); Assert.assertNotNull(response, "The response object is null."); Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(), "The response state should be 200"); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceTypeNotFoundException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceTypeNotFoundException.java new file mode 100644 index 00000000000..d8034cc8cff --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceTypeNotFoundException.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * you may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.common; + +public class DeviceTypeNotFoundException extends Exception { + + private static final long serialVersionUID = 3821589758650454161L; + + public DeviceTypeNotFoundException(String msg, Exception nestedEx) { + super(msg, nestedEx); + } + + public DeviceTypeNotFoundException(String message, Throwable cause) { + super(message, cause); + } + + public DeviceTypeNotFoundException(String msg) { + super(msg); + } + + public DeviceTypeNotFoundException() { + super(); + } + + public DeviceTypeNotFoundException(Throwable cause) { + super(cause); + } + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java index 5e7658ae71b..1c108fbb743 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java @@ -486,7 +486,7 @@ public interface DeviceManagementProviderService { void sendRegistrationEmail(EmailMetaInfo metaInfo) throws DeviceManagementException, ConfigurationManagementException; - FeatureManager getFeatureManager(String deviceType) throws DeviceManagementException; + FeatureManager getFeatureManager(String deviceType) throws DeviceTypeNotFoundException; /** * Proxy method to get the tenant configuration of a given platform. diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index fac5c6faa50..c579623d733 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -39,6 +39,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceNotFoundException; import org.wso2.carbon.device.mgt.common.DeviceNotification; import org.wso2.carbon.device.mgt.common.DevicePropertyNotification; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.InitialOperationConfig; @@ -171,14 +172,14 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv } @Override - public FeatureManager getFeatureManager(String deviceType) throws DeviceManagementException { + public FeatureManager getFeatureManager(String deviceType) throws DeviceTypeNotFoundException { DeviceManager deviceManager = this.getDeviceManager(deviceType); if (deviceManager == null) { if (log.isDebugEnabled()) { log.debug("Device Manager associated with the device type '" + deviceType + "' is null. " + "Therefore, not attempting method 'getFeatureManager'"); } - return null; + throw new DeviceTypeNotFoundException("Device type '" + deviceType + "' not found."); } return deviceManager.getFeatureManager(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index d6269cc7c8e..a57da167bd0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -26,6 +26,7 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; @@ -499,7 +500,14 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { try { RequestValidationUtil.validateDeviceIdentifier(type, id); dms = DeviceMgtAPIUtils.getDeviceManagementService(); - FeatureManager fm = dms.getFeatureManager(type); + FeatureManager fm; + try { + fm = dms.getFeatureManager(type); + } catch (DeviceTypeNotFoundException e) { + return Response.status(Response.Status.NOT_FOUND).entity( + new ErrorResponse.ErrorResponseBuilder().setMessage("No feature manager is " + + "registered with the given type '" + type + "'").build()).build(); + } if (fm == null) { return Response.status(Response.Status.NOT_FOUND).entity( new ErrorResponse.ErrorResponseBuilder().setMessage("No feature manager is " + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java index 1fb5c0c37a8..fa812a775e0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java @@ -22,6 +22,7 @@ package org.wso2.carbon.device.mgt.jaxrs.service.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; @@ -76,11 +77,18 @@ public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementServ DeviceManagementProviderService dms; try { dms = DeviceMgtAPIUtils.getDeviceManagementService(); - FeatureManager fm = dms.getFeatureManager(type); + FeatureManager fm; + try { + fm = dms.getFeatureManager(type); + } catch (DeviceTypeNotFoundException e) { + return Response.status(Response.Status.NOT_FOUND).entity( + new ErrorResponse.ErrorResponseBuilder().setMessage("No feature manager is " + + "registered with the given type '" + type + "'").build()).build(); + } if (fm == null) { return Response.status(Response.Status.NOT_FOUND).entity( new ErrorResponse.ErrorResponseBuilder().setMessage("No feature manager is " + - "registered with the given type '" + type + "'").build()).build(); + "registered with the given type '" + type + "'").build()).build(); } features = fm.getFeatures(); } catch (DeviceManagementException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java index e1935904ae5..c1732254aad 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java @@ -31,9 +31,9 @@ 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.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; @@ -437,7 +437,7 @@ public class DeviceManagementServiceImplTest { } @Test(description = "Testing getting device features when feature manager is not registered for the device type") - public void testGetFeaturesOfDeviceWhenFeatureManagerIsNotRegistered() throws DeviceManagementException { + public void testGetFeaturesOfDeviceWhenFeatureManagerIsNotRegistered() throws DeviceTypeNotFoundException { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); Mockito.when(this.deviceManagementProviderService.getFeatureManager(Mockito.anyString())).thenReturn(null); @@ -448,14 +448,14 @@ public class DeviceManagementServiceImplTest { } @Test(description = "Testing getting device features when unable to get the feature manager") - public void testGetFeaturesException() throws DeviceManagementException { + public void testGetFeaturesException() throws DeviceTypeNotFoundException { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); Mockito.when(this.deviceManagementProviderService.getFeatureManager(Mockito.anyString())) - .thenThrow(new DeviceManagementException()); + .thenThrow(new DeviceTypeNotFoundException()); Response response = this.deviceManagementService .getFeaturesOfDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString(), null); - Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); + Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); Mockito.reset(this.deviceManagementProviderService); } From ea4954ba9d49eda7833f351b42f4a8f69cb61bf1 Mon Sep 17 00:00:00 2001 From: charitha Date: Sun, 21 Apr 2019 17:03:47 +0530 Subject: [PATCH 04/27] Fix policy UI --- .../jaggeryapps/devicemgt/api/data-tables-invoker-api.jag | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag index 146abcf0d06..4271f463bd5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag @@ -59,10 +59,10 @@ if (uriMatcher.match("/{context}/api/data-tables/invoker/filters")) { result.deviceTypes = []; var deviceTypesRes = deviceModule.getDeviceTypes(); if (deviceTypesRes.status === "success") { - var deviceTypes = deviceTypesRes["content"]["deviceTypes"]; + var deviceTypes = deviceTypesRes["content"]; for (i = 0; i < deviceTypes.length; i++) { - var deviceTypeName = deviceTypes[i]; - var deviceTypeLabel = deviceTypeName; + var deviceTypeName = deviceTypes[i].name; + var deviceTypeLabel = deviceTypeName.charAt(0).toUpperCase() + deviceTypeName.slice(1); var configs = utility.getDeviceTypeConfig(deviceTypeLabel); if (configs) { if (configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY]) { From 893328c0ca4bbe57e22a6c49441526efd4b61faf Mon Sep 17 00:00:00 2001 From: charitha Date: Thu, 25 Apr 2019 14:27:35 +0530 Subject: [PATCH 05/27] Fix build failure --- .../device/mgt/core/service/DeviceManagementProviderService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java index 7d3c0fdf525..3fa92a1aed7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderService.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.core.service; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceTypeNotFoundException; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.InvalidDeviceException; From 13511a79c42fb7863b32b9d401f80a0dc1f1928c Mon Sep 17 00:00:00 2001 From: charitha Date: Mon, 6 May 2019 13:47:56 +0530 Subject: [PATCH 06/27] Fix log issue in test cases --- .../mgt/jaxrs/service/impl/ActivityProviderServiceImplTest.java | 2 +- .../mgt/jaxrs/service/impl/ConfigurationServiceImplTest.java | 2 +- .../device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java | 2 +- .../mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java | 2 +- .../service/impl/DeviceTypeManagementAdminServiceTest.java | 2 +- .../mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java | 2 +- .../mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java | 2 ++ .../mgt/jaxrs/service/impl/GroupManagementServiceImplTest.java | 2 +- .../service/impl/NotificationManagementServiceImplTest.java | 2 +- .../mgt/jaxrs/service/impl/UserManagementServiceImplTest.java | 2 +- 10 files changed, 11 insertions(+), 9 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImplTest.java index 0db0ac07b7c..657dc4de0d9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImplTest.java @@ -55,7 +55,7 @@ import static org.mockito.MockitoAnnotations.initMocks; /** * This is a test class for {@link ActivityProviderServiceImpl}. */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({ "org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils", "org.wso2.carbon.context.CarbonContext", "org.wso2.carbon.context.PrivilegedCarbonContext" }) @PrepareForTest({ DeviceMgtAPIUtils.class, PolicyManagerUtil.class, PrivilegedCarbonContext.class }) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ConfigurationServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ConfigurationServiceImplTest.java index 5a4b0cd13b8..ed8478bc11f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ConfigurationServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ConfigurationServiceImplTest.java @@ -44,7 +44,7 @@ import java.util.List; /** * This is a test class for {@link ConfigurationServiceImpl}. */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils", "org.wso2.carbon.context.CarbonContext"}) @PrepareForTest({DeviceMgtAPIUtils.class, PolicyManagerUtil.class}) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java index efd573b11f6..44c23440d9a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java @@ -75,7 +75,7 @@ import static org.mockito.MockitoAnnotations.initMocks; /** * This class holds the unit tests for the class {@link DeviceAgentServiceImpl} */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils", "org.wso2.carbon.context.CarbonContext", "org.wso2.carbon.context.internal.CarbonContextDataHolder"}) @PrepareForTest({DeviceMgtAPIUtils.class, DeviceManagementProviderService.class, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java index 51aeaabde64..27e84c7fc9c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java @@ -68,7 +68,7 @@ import static org.mockito.MockitoAnnotations.initMocks; /** * This class includes unit tests for testing the functionality of {@link DeviceManagementServiceImpl} */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils", "org.wso2.carbon.context.CarbonContext"}) @PrepareForTest({DeviceMgtAPIUtils.class, MultitenantUtils.class, CarbonContext.class}) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java index 1b8910507db..9c129cd5932 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java @@ -48,7 +48,7 @@ import static org.mockito.MockitoAnnotations.initMocks; /** * This class holds the unit tests for the class {@link DeviceTypeManagementAdminService} */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils"}) @PrepareForTest({DeviceMgtAPIUtils.class, DeviceManagementProviderService.class}) public class DeviceTypeManagementAdminServiceTest { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java index 7143108184b..fa320b5b5fd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java @@ -48,7 +48,7 @@ import static org.mockito.MockitoAnnotations.initMocks; /** * This class holds the unit tests for the class {@link DeviceTypeManagementService} */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils"}) @PrepareForTest({DeviceMgtAPIUtils.class, DeviceManagementProviderService.class}) public class DeviceTypeManagementServiceTest { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java index b655b1095ed..befc2b47d60 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java @@ -1,6 +1,7 @@ package org.wso2.carbon.device.mgt.jaxrs.service.impl; 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; @@ -15,6 +16,7 @@ import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.List; +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) public class GeoLocationBasedServiceImplTest { private DeviceManagementProviderService deviceManagementProviderService; private PrivilegedCarbonContext context; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImplTest.java index d3c42b794a9..9a4829cb568 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImplTest.java @@ -54,7 +54,7 @@ import java.util.List; /** * This is a test case for {@link GroupManagementServiceImpl}. */ -@PowerMockIgnore({"javax.ws.rs.*", "javax.xml.parsers"}) +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*", "javax.xml.parsers"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils", "org.wso2.carbon.context.PrivilegedCarbonContext"}) @PrepareForTest({DeviceMgtAPIUtils.class, CarbonContext.class}) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImplTest.java index 92e321745f3..75a7f3cd1c2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImplTest.java @@ -46,7 +46,7 @@ import static org.mockito.MockitoAnnotations.initMocks; /** * This is a test class for {@link NotificationManagementServiceImpl}. */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils", "org.wso2.carbon.context.CarbonContext"}) @PrepareForTest({DeviceMgtAPIUtils.class, MultitenantUtils.class, CarbonContext.class}) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImplTest.java index bcee738b6e2..d6984503cba 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImplTest.java @@ -58,7 +58,7 @@ import static org.mockito.MockitoAnnotations.initMocks; /** * This is a test case for {@link UserManagementService}. */ -@PowerMockIgnore("javax.ws.rs.*") +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) @SuppressStaticInitializationFor({"org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils", "org.wso2.carbon.context.CarbonContext"}) @PrepareForTest({DeviceMgtAPIUtils.class, MultitenantUtils.class, CarbonContext.class}) From 3b905f450a73c4ece361f97be4ce6993221d1eb2 Mon Sep 17 00:00:00 2001 From: charitha Date: Mon, 17 Jun 2019 09:36:54 +0530 Subject: [PATCH 07/27] Fix https://gitlab.com/entgra/product-iots/issues/109 --- .../src/main/resources/dbscripts/cdm/h2.sql | 4 ++-- .../src/main/resources/dbscripts/cdm/mssql.sql | 4 ++-- .../src/main/resources/dbscripts/cdm/mysql.sql | 4 ++-- .../src/main/resources/dbscripts/cdm/oracle.sql | 4 ++-- .../src/main/resources/dbscripts/cdm/postgresql.sql | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql index 6e4989721a6..95d54b8da12 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS DM_GROUP ( ID INTEGER AUTO_INCREMENT NOT NULL, GROUP_NAME VARCHAR(100) DEFAULT NULL, DESCRIPTION TEXT DEFAULT NULL, - OWNER VARCHAR(45) DEFAULT NULL, + OWNER VARCHAR(255) DEFAULT NULL, TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (ID) ); @@ -110,7 +110,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_OPERATION ( CREATE TABLE IF NOT EXISTS DM_ENROLMENT ( ID INTEGER AUTO_INCREMENT NOT NULL, DEVICE_ID INTEGER NOT NULL, - OWNER VARCHAR(50) NOT NULL, + OWNER VARCHAR(255) NOT NULL, OWNERSHIP VARCHAR(45) DEFAULT NULL, STATUS VARCHAR(50) NULL, DATE_OF_ENROLMENT TIMESTAMP DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql index 8d6bb0fb7d1..eb423d96bf0 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -20,7 +20,7 @@ IF NOT EXISTS(SELECT * ID INTEGER IDENTITY (1, 1) NOT NULL, GROUP_NAME VARCHAR(100) DEFAULT NULL, DESCRIPTION VARCHAR(MAX) DEFAULT NULL, - OWNER VARCHAR(45) DEFAULT NULL, + OWNER VARCHAR(255) DEFAULT NULL, TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (ID) ); @@ -140,7 +140,7 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[D CREATE TABLE DM_ENROLMENT ( ID INTEGER IDENTITY(1,1) NOT NULL, DEVICE_ID INTEGER NOT NULL, - OWNER VARCHAR(50) NOT NULL, + OWNER VARCHAR(255) NOT NULL, OWNERSHIP VARCHAR(45) DEFAULT NULL, STATUS VARCHAR(50) NULL, DATE_OF_ENROLMENT DATETIME2 DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql index 0ff005b6b92..2363beb5e76 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS DM_GROUP ( ID INTEGER AUTO_INCREMENT NOT NULL, GROUP_NAME VARCHAR(100) DEFAULT NULL, DESCRIPTION TEXT DEFAULT NULL, - OWNER VARCHAR(45) DEFAULT NULL, + OWNER VARCHAR(255) DEFAULT NULL, TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (ID) ) @@ -125,7 +125,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_OPERATION ( CREATE TABLE IF NOT EXISTS DM_ENROLMENT ( ID INTEGER AUTO_INCREMENT NOT NULL, DEVICE_ID INTEGER NOT NULL, - OWNER VARCHAR(50) NOT NULL, + OWNER VARCHAR(255) NOT NULL, OWNERSHIP VARCHAR(45) DEFAULT NULL, STATUS VARCHAR(50) NULL, DATE_OF_ENROLMENT TIMESTAMP NULL DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql index 9ebdcf56153..f1d73729b01 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -27,7 +27,7 @@ CREATE TABLE DM_GROUP ( ID NUMBER(10) NOT NULL, DESCRIPTION CLOB DEFAULT NULL, GROUP_NAME VARCHAR2(100) DEFAULT NULL, - OWNER VARCHAR2(45) DEFAULT NULL, + OWNER VARCHAR2(255) DEFAULT NULL, TENANT_ID NUMBER(10) DEFAULT 0, CONSTRAINT PK_DM_GROUP PRIMARY KEY (ID) ) @@ -201,7 +201,7 @@ CREATE TABLE DM_PROFILE_OPERATION ( CREATE TABLE DM_ENROLMENT ( ID NUMBER(10) NOT NULL, DEVICE_ID NUMBER(10) NOT NULL, - OWNER VARCHAR2(50) NOT NULL, + OWNER VARCHAR2(255) NOT NULL, OWNERSHIP VARCHAR2(45) DEFAULT NULL, STATUS VARCHAR2(50) NULL, DATE_OF_ENROLMENT TIMESTAMP(0) DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql index 4ef06be29cd..e401f099f78 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS DM_GROUP ( ID BIGSERIAL NOT NULL PRIMARY KEY, GROUP_NAME VARCHAR(100) DEFAULT NULL, DESCRIPTION TEXT DEFAULT NULL, - OWNER VARCHAR(45) DEFAULT NULL, + OWNER VARCHAR(255) DEFAULT NULL, TENANT_ID INTEGER DEFAULT 0 ); @@ -108,7 +108,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_OPERATION ( CREATE TABLE IF NOT EXISTS DM_ENROLMENT ( ID BIGSERIAL NOT NULL PRIMARY KEY, DEVICE_ID INTEGER NOT NULL, - OWNER VARCHAR(50) NOT NULL, + OWNER VARCHAR(255) NOT NULL, OWNERSHIP VARCHAR(45) DEFAULT NULL, STATUS VARCHAR(50) NULL, DATE_OF_ENROLMENT TIMESTAMP NULL DEFAULT NULL, From bb82eb723605e008b95db0b691a84b7831a93366 Mon Sep 17 00:00:00 2001 From: charitha Date: Tue, 13 Aug 2019 00:08:58 +0530 Subject: [PATCH 08/27] Fix issue in IoT device type loading --- .../impl/admin/DeviceTypeManagementAdminServiceImpl.java | 8 ++++++-- .../devicemgt/app/modules/business-controllers/device.js | 9 --------- .../app/pages/cdmf.page.devicetype.edit/edit.js | 2 +- .../cdmf.page.devicetype.edit/public/js/bottomJs.js | 2 +- .../device-view.js | 2 +- .../cdmf.unit.default.device.type.type-view/type-view.js | 2 +- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java index d7f659871db..02c807df559 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java @@ -137,7 +137,8 @@ public class DeviceTypeManagementAdminServiceImpl implements DeviceTypeManagemen @Override @PUT - public Response updateDeviceType(String type, DeviceType deviceType) { + @Path("/{type}") + public Response updateDeviceType(@PathParam("type") String type, DeviceType deviceType) { if (deviceType != null && deviceType.getDeviceTypeMetaDefinition() != null) { if (deviceType.getName() == null || !deviceType.getName().equals(type)) { return Response.status(Response.Status.BAD_REQUEST).entity("Type name mismatch. Expected: '" + type + @@ -163,7 +164,10 @@ public class DeviceTypeManagementAdminServiceImpl implements DeviceTypeManagemen } @Override - public Response addDeviceTypePlatformConfig(String type, PlatformConfiguration platformConfiguration) { + @POST + @Path("/{type}/configs") + public Response addDeviceTypePlatformConfig(@PathParam("type") String type, + PlatformConfiguration platformConfiguration) { boolean isSaved; if (platformConfiguration.getType() == null || !platformConfiguration.getType().equals(type)) { return Response.status(Response.Status.BAD_REQUEST).entity("Type name mismatch. Expected: '" + type + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js index ca8fa6dbd82..c39e797bc2a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js @@ -327,15 +327,6 @@ deviceModule = function () { return response; }; - publicMethods.getDeviceTypesConfig = function () { - var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/device-types/config"; - var response = privateMethods.callBackend(url, constants["HTTP_GET"]); - if (response.status == "success") { - response.content = parse(response.content); - } - return response; - }; - /* @Updated */ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.js index 94284ac0164..692f6923023 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/edit.js @@ -35,7 +35,7 @@ function onRequest(context) { var deviceType = request.getParameter("type"); var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; var restAPIEndpoint = deviceMgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] - + "/device-types/config/" + deviceType; + + "/device-types/" + deviceType; displayData.name = deviceType; serviceInvokers.XMLHttp.get( restAPIEndpoint, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/js/bottomJs.js index 3fd2548a6fe..320d630efe8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/js/bottomJs.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devicetype.edit/public/js/bottomJs.js @@ -210,7 +210,7 @@ $(document).ready(function () { }); deviceType.deviceTypeMetaDefinition.features = features; - var addRoleAPI = apiBasePath + "/admin/device-types"; + var addRoleAPI = apiBasePath + "/admin/device-types/" + deviceType.name; invokerUtil.put( addRoleAPI, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.device-view/device-view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.device-view/device-view.js index cf716ef35c2..a431c66a71f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.device-view/device-view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.device-view/device-view.js @@ -42,7 +42,7 @@ function onRequest(context) { var displayData = {}; var restAPIEndpoint = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] - + "/device-types/config/" + deviceType; + + "/device-types/" + deviceType; displayData.deviceType = deviceType; displayData.tenantDomain = tenantDomain; serviceInvokers.XMLHttp.get( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.type-view/type-view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.type-view/type-view.js index 0f3563bad17..0f24173632d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.type-view/type-view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.default.device.type.type-view/type-view.js @@ -32,7 +32,7 @@ function onRequest(context) { return opts.inverse(this); }); var restAPIEndpoint = deviceMgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] - + "/device-types/config/" + deviceType; + + "/device-types/" + deviceType; displayData.deviceType = deviceType; displayData.tenantDomain = tenantDomain; serviceInvokers.XMLHttp.get( From 0d0daa5b8b56bc352155233636f22da6dfd64ce5 Mon Sep 17 00:00:00 2001 From: charitha Date: Thu, 15 Aug 2019 14:09:37 +0530 Subject: [PATCH 09/27] Fix CN extraction issue --- .../mgt/core/impl/CertificateGenerator.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java index 71ce11b6b17..b25837154f8 100755 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java @@ -324,9 +324,14 @@ public class CertificateGenerator { KeyStoreReader keyStoreReader = new KeyStoreReader(); if (distinguishedName != null && !distinguishedName.isEmpty()) { if (distinguishedName.contains("/CN=")) { - String[] dnSplits = distinguishedName.split("/CN="); - String commonNameExtracted = dnSplits[dnSplits.length - 1]; - lookUpCertificate = keyStoreReader.getCertificateBySerial(commonNameExtracted); + String[] dnSplits = distinguishedName.split("/"); + for (String dnPart : dnSplits) { + if (dnPart.contains("CN=")) { + String commonNameExtracted = dnPart.replace("CN=", ""); + lookUpCertificate = keyStoreReader.getCertificateBySerial(commonNameExtracted); + break; + } + } } else { LdapName ldapName; try { @@ -711,4 +716,4 @@ public class CertificateGenerator { return generateCertificateFromCSR(privateKeyCA, certificationRequest, certCA.getIssuerX500Principal().getName()); } -} \ No newline at end of file +} From 18218a351c4e72b92008abd03bd8802d1aeba1b5 Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 15 Aug 2019 15:12:42 +0530 Subject: [PATCH 10/27] Fixing issues with searching devices with groupID as a param --- .../carbon/device/mgt/core/dao/DeviceDAO.java | 11 ++ .../dao/impl/device/GenericDeviceDAOImpl.java | 131 ++++++++++++++++++ .../dao/impl/device/OracleDeviceDAOImpl.java | 131 ++++++++++++++++++ .../impl/device/PostgreSQLDeviceDAOImpl.java | 130 +++++++++++++++++ .../impl/device/SQLServerDeviceDAOImpl.java | 130 +++++++++++++++++ .../DeviceManagementProviderServiceImpl.java | 6 +- .../cdmf.page.devices/public/js/listing.js | 5 +- .../dataTables.extended.serversidepaging.js | 3 + 8 files changed, 544 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceDAO.java index 5ea2a87b5b6..6cb16016e60 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceDAO.java @@ -277,6 +277,17 @@ public interface DeviceDAO { */ List getDevices(PaginationRequest request, int tenantId) throws DeviceManagementDAOException; + + /** + * This method is used to search for devices within a specific group. + * + * @param request PaginationRequest object holding the data for pagination + * @param tenantId tenant id. + * @return returns paginated list of devices. + * @throws DeviceManagementDAOException + */ + List searchDevicesInGroup(PaginationRequest request, int tenantId) throws DeviceManagementDAOException; + /** * This method is used to retrieve all the devices of a given tenant and device type. * diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java index 872ea7c2857..8f38bc9d73b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java @@ -153,6 +153,137 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl { return devices; } + + @Override + public List searchDevicesInGroup(PaginationRequest request, int tenantId) + throws DeviceManagementDAOException { + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + List devices = null; + + int groupId = request.getGroupId(); + String deviceType = request.getDeviceType(); + boolean isDeviceTypeProvided = false; + String deviceName = request.getDeviceName(); + boolean isDeviceNameProvided = false; + String owner = request.getOwner(); + boolean isOwnerProvided = false; + String ownerPattern = request.getOwnerPattern(); + boolean isOwnerPatternProvided = false; + String ownership = request.getOwnership(); + boolean isOwnershipProvided = false; + String status = request.getStatus(); + boolean isStatusProvided = false; + Date since = request.getSince(); + boolean isSinceProvided = false; + + try { + conn = this.getConnection(); + String sql = "SELECT d1.DEVICE_ID, d1.DESCRIPTION, d1.NAME AS DEVICE_NAME, d1.DEVICE_TYPE, " + + "d1.DEVICE_IDENTIFICATION, e.OWNER, e.OWNERSHIP, e.STATUS, e.DATE_OF_LAST_UPDATE, " + + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, " + + "(SELECT gd.DEVICE_ID, gd.DESCRIPTION, gd.NAME, gd.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE " + + "FROM (SELECT d.ID AS DEVICE_ID, d.DESCRIPTION, d.NAME, d.DEVICE_IDENTIFICATION, d.DEVICE_TYPE_ID " + + "FROM DM_DEVICE d, (SELECT dgm.DEVICE_ID FROM DM_DEVICE_GROUP_MAP dgm WHERE dgm.GROUP_ID = ?) dgm1 WHERE" + + " d.ID = dgm1.DEVICE_ID AND d.TENANT_ID = ?"; + + + //Add the query for device-name + if (deviceName != null && !deviceName.isEmpty()) { + sql = sql + " AND d.NAME LIKE ?"; + isDeviceNameProvided = true; + } + + sql = sql + ") gd, DM_DEVICE_TYPE t"; + + if (since != null) { + sql = sql + ", DM_DEVICE_DETAIL dt"; + isSinceProvided = true; + } + + sql = sql + " WHERE gd.DEVICE_TYPE_ID = t.ID"; + + //Add query for last updated timestamp + if (isSinceProvided) { + sql = sql + " AND dt.DEVICE_ID = gd.DEVICE_ID AND dt.UPDATE_TIMESTAMP > ?"; + } + + //Add the query for device-type + if (deviceType != null && !deviceType.isEmpty()) { + sql = sql + " AND t.NAME = ?"; + isDeviceTypeProvided = true; + } + + sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? "; + + //Add the query for ownership + if (ownership != null && !ownership.isEmpty()) { + sql = sql + " AND e.OWNERSHIP = ?"; + isOwnershipProvided = true; + } + //Add the query for owner + if (owner != null && !owner.isEmpty()) { + sql = sql + " AND e.OWNER = ?"; + isOwnerProvided = true; + } else if (ownerPattern != null && !ownerPattern.isEmpty()) { + sql = sql + " AND e.OWNER LIKE ?"; + isOwnerPatternProvided = true; + } + //Add the query for status + if (status != null && !status.isEmpty()) { + sql = sql + " AND e.STATUS = ?"; + isStatusProvided = true; + } + + sql = sql + " LIMIT ?,?"; + + stmt = conn.prepareStatement(sql); + + stmt.setInt(1, groupId); + stmt.setInt(2, tenantId); + + int paramIdx = 3; + if (isDeviceNameProvided) { + stmt.setString(paramIdx++, deviceName + "%"); + } + if (isSinceProvided) { + stmt.setLong(paramIdx++, since.getTime()); + } + if (isDeviceTypeProvided) { + stmt.setString(paramIdx++, deviceType); + } + + stmt.setInt(paramIdx++, tenantId); + if (isOwnershipProvided) { + stmt.setString(paramIdx++, ownership); + } + if (isOwnerProvided) { + stmt.setString(paramIdx++, owner); + } else if (isOwnerPatternProvided) { + stmt.setString(paramIdx++, ownerPattern + "%"); + } + if (isStatusProvided) { + stmt.setString(paramIdx++, status); + } + stmt.setInt(paramIdx++, request.getStartIndex()); + stmt.setInt(paramIdx, request.getRowCount()); + + rs = stmt.executeQuery(); + devices = new ArrayList<>(); + while (rs.next()) { + Device device = DeviceManagementDAOUtil.loadDevice(rs); + devices.add(device); + } + } catch (SQLException e) { + throw new DeviceManagementDAOException("Error occurred while retrieving information of" + + " devices belonging to group : " + groupId, e); + } finally { + DeviceManagementDAOUtil.cleanupResources(stmt, rs); + } + return devices; + } + @Override public List getDevicesOfUser(PaginationRequest request, int tenantId) throws DeviceManagementDAOException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java index 33875fc9c78..2d568fed7e9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java @@ -159,6 +159,137 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl { return devices; } + @Override + public List searchDevicesInGroup(PaginationRequest request, int tenantId) + throws DeviceManagementDAOException { + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + List devices = null; + + int groupId = request.getGroupId(); + String deviceType = request.getDeviceType(); + boolean isDeviceTypeProvided = false; + String deviceName = request.getDeviceName(); + boolean isDeviceNameProvided = false; + String owner = request.getOwner(); + boolean isOwnerProvided = false; + String ownerPattern = request.getOwnerPattern(); + boolean isOwnerPatternProvided = false; + String ownership = request.getOwnership(); + boolean isOwnershipProvided = false; + String status = request.getStatus(); + boolean isStatusProvided = false; + Date since = request.getSince(); + boolean isSinceProvided = false; + + try { + conn = this.getConnection(); + String sql = "SELECT d1.DEVICE_ID, d1.DESCRIPTION, d1.NAME AS DEVICE_NAME, d1.DEVICE_TYPE, " + + "d1.DEVICE_IDENTIFICATION, e.OWNER, e.OWNERSHIP, e.STATUS, e.DATE_OF_LAST_UPDATE, " + + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, " + + "(SELECT gd.DEVICE_ID, gd.DESCRIPTION, gd.NAME, gd.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE " + + "FROM (SELECT d.ID AS DEVICE_ID, d.DESCRIPTION, d.NAME, d.DEVICE_IDENTIFICATION, d.DEVICE_TYPE_ID " + + "FROM DM_DEVICE d, (SELECT dgm.DEVICE_ID FROM DM_DEVICE_GROUP_MAP dgm WHERE dgm.GROUP_ID = ?) dgm1 WHERE" + + " d.ID = dgm1.DEVICE_ID AND d.TENANT_ID = ?"; + + + //Add the query for device-name + if (deviceName != null && !deviceName.isEmpty()) { + sql = sql + " AND d.NAME LIKE ?"; + isDeviceNameProvided = true; + } + + sql = sql + ") gd, DM_DEVICE_TYPE t"; + + if (since != null) { + sql = sql + ", DM_DEVICE_DETAIL dt"; + isSinceProvided = true; + } + + sql = sql + " WHERE gd.DEVICE_TYPE_ID = t.ID"; + + //Add query for last updated timestamp + if (isSinceProvided) { + sql = sql + " AND dt.DEVICE_ID = gd.DEVICE_ID AND dt.UPDATE_TIMESTAMP > ?"; + } + + //Add the query for device-type + if (deviceType != null && !deviceType.isEmpty()) { + sql = sql + " AND t.NAME = ?"; + isDeviceTypeProvided = true; + } + + sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? "; + + //Add the query for ownership + if (ownership != null && !ownership.isEmpty()) { + sql = sql + " AND e.OWNERSHIP = ?"; + isOwnershipProvided = true; + } + //Add the query for owner + if (owner != null && !owner.isEmpty()) { + sql = sql + " AND e.OWNER = ?"; + isOwnerProvided = true; + } else if (ownerPattern != null && !ownerPattern.isEmpty()) { + sql = sql + " AND e.OWNER LIKE ?"; + isOwnerPatternProvided = true; + } + //Add the query for status + if (status != null && !status.isEmpty()) { + sql = sql + " AND e.STATUS = ?"; + isStatusProvided = true; + } + + sql = sql + " ORDER BY ENROLMENT_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; + + stmt = conn.prepareStatement(sql); + + stmt.setInt(1, groupId); + stmt.setInt(2, tenantId); + + int paramIdx = 3; + if (isDeviceNameProvided) { + stmt.setString(paramIdx++, deviceName + "%"); + } + if (isSinceProvided) { + stmt.setLong(paramIdx++, since.getTime()); + } + if (isDeviceTypeProvided) { + stmt.setString(paramIdx++, deviceType); + } + + stmt.setInt(paramIdx++, tenantId); + if (isOwnershipProvided) { + stmt.setString(paramIdx++, ownership); + } + if (isOwnerProvided) { + stmt.setString(paramIdx++, owner); + } else if (isOwnerPatternProvided) { + stmt.setString(paramIdx++, ownerPattern + "%"); + } + if (isStatusProvided) { + stmt.setString(paramIdx++, status); + } + stmt.setInt(paramIdx++, request.getStartIndex()); + stmt.setInt(paramIdx, request.getRowCount()); + + rs = stmt.executeQuery(); + devices = new ArrayList<>(); + while (rs.next()) { + Device device = DeviceManagementDAOUtil.loadDevice(rs); + devices.add(device); + } + } catch (SQLException e) { + throw new DeviceManagementDAOException("Error occurred while retrieving information of" + + " devices belonging to group : " + groupId, e); + } finally { + DeviceManagementDAOUtil.cleanupResources(stmt, rs); + } + return devices; + } + + @Override public List getDevicesOfUser(PaginationRequest request, int tenantId) throws DeviceManagementDAOException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java index f8bce9b286b..e46d460bcb0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java @@ -140,6 +140,136 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl { return devices; } + @Override + public List searchDevicesInGroup(PaginationRequest request, int tenantId) + throws DeviceManagementDAOException { + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + List devices = null; + + int groupId = request.getGroupId(); + String deviceType = request.getDeviceType(); + boolean isDeviceTypeProvided = false; + String deviceName = request.getDeviceName(); + boolean isDeviceNameProvided = false; + String owner = request.getOwner(); + boolean isOwnerProvided = false; + String ownerPattern = request.getOwnerPattern(); + boolean isOwnerPatternProvided = false; + String ownership = request.getOwnership(); + boolean isOwnershipProvided = false; + String status = request.getStatus(); + boolean isStatusProvided = false; + Date since = request.getSince(); + boolean isSinceProvided = false; + + try { + conn = this.getConnection(); + String sql = "SELECT d1.DEVICE_ID, d1.DESCRIPTION, d1.NAME AS DEVICE_NAME, d1.DEVICE_TYPE, " + + "d1.DEVICE_IDENTIFICATION, e.OWNER, e.OWNERSHIP, e.STATUS, e.DATE_OF_LAST_UPDATE, " + + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, " + + "(SELECT gd.DEVICE_ID, gd.DESCRIPTION, gd.NAME, gd.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE " + + "FROM (SELECT d.ID AS DEVICE_ID, d.DESCRIPTION, d.NAME, d.DEVICE_IDENTIFICATION, d.DEVICE_TYPE_ID " + + "FROM DM_DEVICE d, (SELECT dgm.DEVICE_ID FROM DM_DEVICE_GROUP_MAP dgm WHERE dgm.GROUP_ID = ?) dgm1 WHERE" + + " d.ID = dgm1.DEVICE_ID AND d.TENANT_ID = ?"; + + + //Add the query for device-name + if (deviceName != null && !deviceName.isEmpty()) { + sql = sql + " AND d.NAME LIKE ?"; + isDeviceNameProvided = true; + } + + sql = sql + ") gd, DM_DEVICE_TYPE t"; + + if (since != null) { + sql = sql + ", DM_DEVICE_DETAIL dt"; + isSinceProvided = true; + } + + sql = sql + " WHERE gd.DEVICE_TYPE_ID = t.ID"; + + //Add query for last updated timestamp + if (isSinceProvided) { + sql = sql + " AND dt.DEVICE_ID = gd.DEVICE_ID AND dt.UPDATE_TIMESTAMP > ?"; + } + + //Add the query for device-type + if (deviceType != null && !deviceType.isEmpty()) { + sql = sql + " AND t.NAME = ?"; + isDeviceTypeProvided = true; + } + + sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? "; + + //Add the query for ownership + if (ownership != null && !ownership.isEmpty()) { + sql = sql + " AND e.OWNERSHIP = ?"; + isOwnershipProvided = true; + } + //Add the query for owner + if (owner != null && !owner.isEmpty()) { + sql = sql + " AND e.OWNER = ?"; + isOwnerProvided = true; + } else if (ownerPattern != null && !ownerPattern.isEmpty()) { + sql = sql + " AND e.OWNER LIKE ?"; + isOwnerPatternProvided = true; + } + //Add the query for status + if (status != null && !status.isEmpty()) { + sql = sql + " AND e.STATUS = ?"; + isStatusProvided = true; + } + + sql = sql + " LIMIT ? OFFSET ?"; + + stmt = conn.prepareStatement(sql); + + stmt.setInt(1, groupId); + stmt.setInt(2, tenantId); + + int paramIdx = 3; + if (isDeviceNameProvided) { + stmt.setString(paramIdx++, deviceName + "%"); + } + if (isSinceProvided) { + stmt.setLong(paramIdx++, since.getTime()); + } + if (isDeviceTypeProvided) { + stmt.setString(paramIdx++, deviceType); + } + + stmt.setInt(paramIdx++, tenantId); + if (isOwnershipProvided) { + stmt.setString(paramIdx++, ownership); + } + if (isOwnerProvided) { + stmt.setString(paramIdx++, owner); + } else if (isOwnerPatternProvided) { + stmt.setString(paramIdx++, ownerPattern + "%"); + } + if (isStatusProvided) { + stmt.setString(paramIdx++, status); + } + stmt.setInt(paramIdx, request.getRowCount()); + stmt.setInt(paramIdx++, request.getStartIndex()); + + rs = stmt.executeQuery(); + devices = new ArrayList<>(); + while (rs.next()) { + Device device = DeviceManagementDAOUtil.loadDevice(rs); + devices.add(device); + } + } catch (SQLException e) { + throw new DeviceManagementDAOException("Error occurred while retrieving information of" + + " devices belonging to group : " + groupId, e); + } finally { + DeviceManagementDAOUtil.cleanupResources(stmt, rs); + } + return devices; + } + @Override public List getDevicesOfUser(PaginationRequest request, int tenantId) throws DeviceManagementDAOException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java index ee60068fa8f..12635fd1a19 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java @@ -156,6 +156,136 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl { return devices; } + @Override + public List searchDevicesInGroup(PaginationRequest request, int tenantId) + throws DeviceManagementDAOException { + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + List devices = null; + + int groupId = request.getGroupId(); + String deviceType = request.getDeviceType(); + boolean isDeviceTypeProvided = false; + String deviceName = request.getDeviceName(); + boolean isDeviceNameProvided = false; + String owner = request.getOwner(); + boolean isOwnerProvided = false; + String ownerPattern = request.getOwnerPattern(); + boolean isOwnerPatternProvided = false; + String ownership = request.getOwnership(); + boolean isOwnershipProvided = false; + String status = request.getStatus(); + boolean isStatusProvided = false; + Date since = request.getSince(); + boolean isSinceProvided = false; + + try { + conn = this.getConnection(); + String sql = "SELECT d1.DEVICE_ID, d1.DESCRIPTION, d1.NAME AS DEVICE_NAME, d1.DEVICE_TYPE, " + + "d1.DEVICE_IDENTIFICATION, e.OWNER, e.OWNERSHIP, e.STATUS, e.DATE_OF_LAST_UPDATE, " + + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, " + + "(SELECT gd.DEVICE_ID, gd.DESCRIPTION, gd.NAME, gd.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE " + + "FROM (SELECT d.ID AS DEVICE_ID, d.DESCRIPTION, d.NAME, d.DEVICE_IDENTIFICATION, d.DEVICE_TYPE_ID " + + "FROM DM_DEVICE d, (SELECT dgm.DEVICE_ID FROM DM_DEVICE_GROUP_MAP dgm WHERE dgm.GROUP_ID = ?) dgm1 WHERE" + + " d.ID = dgm1.DEVICE_ID AND d.TENANT_ID = ?"; + + + //Add the query for device-name + if (deviceName != null && !deviceName.isEmpty()) { + sql = sql + " AND d.NAME LIKE ?"; + isDeviceNameProvided = true; + } + + sql = sql + ") gd, DM_DEVICE_TYPE t"; + + if (since != null) { + sql = sql + ", DM_DEVICE_DETAIL dt"; + isSinceProvided = true; + } + + sql = sql + " WHERE gd.DEVICE_TYPE_ID = t.ID"; + + //Add query for last updated timestamp + if (isSinceProvided) { + sql = sql + " AND dt.DEVICE_ID = gd.DEVICE_ID AND dt.UPDATE_TIMESTAMP > ?"; + } + + //Add the query for device-type + if (deviceType != null && !deviceType.isEmpty()) { + sql = sql + " AND t.NAME = ?"; + isDeviceTypeProvided = true; + } + + sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? "; + + //Add the query for ownership + if (ownership != null && !ownership.isEmpty()) { + sql = sql + " AND e.OWNERSHIP = ?"; + isOwnershipProvided = true; + } + //Add the query for owner + if (owner != null && !owner.isEmpty()) { + sql = sql + " AND e.OWNER = ?"; + isOwnerProvided = true; + } else if (ownerPattern != null && !ownerPattern.isEmpty()) { + sql = sql + " AND e.OWNER LIKE ?"; + isOwnerPatternProvided = true; + } + //Add the query for status + if (status != null && !status.isEmpty()) { + sql = sql + " AND e.STATUS = ?"; + isStatusProvided = true; + } + + sql = sql + " ORDER BY ENROLMENT_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; + + stmt = conn.prepareStatement(sql); + + stmt.setInt(1, groupId); + stmt.setInt(2, tenantId); + + int paramIdx = 3; + if (isDeviceNameProvided) { + stmt.setString(paramIdx++, deviceName + "%"); + } + if (isSinceProvided) { + stmt.setLong(paramIdx++, since.getTime()); + } + if (isDeviceTypeProvided) { + stmt.setString(paramIdx++, deviceType); + } + + stmt.setInt(paramIdx++, tenantId); + if (isOwnershipProvided) { + stmt.setString(paramIdx++, ownership); + } + if (isOwnerProvided) { + stmt.setString(paramIdx++, owner); + } else if (isOwnerPatternProvided) { + stmt.setString(paramIdx++, ownerPattern + "%"); + } + if (isStatusProvided) { + stmt.setString(paramIdx++, status); + } + stmt.setInt(paramIdx++, request.getStartIndex()); + stmt.setInt(paramIdx, request.getRowCount()); + + rs = stmt.executeQuery(); + devices = new ArrayList<>(); + while (rs.next()) { + Device device = DeviceManagementDAOUtil.loadDevice(rs); + devices.add(device); + } + } catch (SQLException e) { + throw new DeviceManagementDAOException("Error occurred while retrieving information of" + + " devices belonging to group : " + groupId, e); + } finally { + DeviceManagementDAOUtil.cleanupResources(stmt, rs); + } + return devices; + } + @Override public List getDevicesOfUser(PaginationRequest request, int tenantId) throws DeviceManagementDAOException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 11b6866433f..e3a2fb8fa90 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -824,7 +824,11 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv } else { try { DeviceManagementDAOFactory.openConnection(); - allDevices = deviceDAO.getDevices(request, tenantId); + if(request.getGroupId()!=0){ + allDevices = deviceDAO.searchDevicesInGroup(request, tenantId); + } else{ + allDevices = deviceDAO.getDevices(request, tenantId); + } count = deviceDAO.getDeviceCount(request, tenantId); } catch (DeviceManagementDAOException e) { String msg = "Error occurred while retrieving device list pertaining to the current tenant"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js index fbba497e09e..2448a89f8f5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js @@ -506,7 +506,7 @@ function loadDevices(searchType, searchParam) { $('#device-grid').datatables_extended_serverside_paging( null, - serviceURL, + "/api/device-mgt/v1.0/devices/", dataFilter, columns, fnCreatedRow, @@ -525,7 +525,8 @@ function loadDevices(searchType, searchParam) { }, { "placeholder": "Top-Device-Name-Search", - "searchKey": "namePattern" + "searchKey": "namePattern", + "groupId": groupId } ); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js index aff3ea3942d..3f8e0a7b645 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js @@ -76,6 +76,9 @@ $.fn.datatables_extended_serverside_paging = function (settings, url, dataFilter searchParams[params.columns[i].data] = encodeURIComponent(params.columns[i].search.value); } if (options) { + if (options.groupId){ + searchParams["groupId"] = options.groupId; + } searchParams[options.searchKey] = encodeURIComponent(params.search.value); } params.filter = JSON.stringify(searchParams); From 1c825af79d6c0da0ee87727531c93cd305bf615c Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 15 Aug 2019 17:08:21 +0530 Subject: [PATCH 11/27] Move delete device permanently to device-mgt admin API --- .../service/api/DeviceManagementService.java | 7 +- .../admin/DeviceManagementAdminService.java | 90 +++++++++++++++++++ .../impl/DeviceManagementServiceImpl.java | 14 +-- .../DeviceManagementAdminServiceImpl.java | 45 +++++++++- .../impl/DeviceManagementServiceImplTest.java | 9 +- 5 files changed, 138 insertions(+), 27 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index 4cf332c0b8f..aba6d9819ce 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -901,12 +901,7 @@ public interface DeviceManagementService { required = true) @PathParam("device-id") @Size(max = 45) - String deviceId, - @ApiParam( - name = "permanentDelete", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) - @QueryParam("permanentDelete") boolean permanentDelete); + String deviceId); @GET @Path("/{type}/{id}/features") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java index b96977adfb1..4377c9d1855 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java @@ -15,6 +15,22 @@ * specific language governing permissions and limitations * under the License. * + * + * Copyright (c) 2019, Entgra (pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.jaxrs.service.api.admin; @@ -76,6 +92,12 @@ import java.util.List; description = "Update the ownership of the device", key = "perm:admin:devices:update-enrollment", permissions = {"/device-mgt/admin/devices/update-enrollment"} + ), + @Scope( + name = "Permanently Delete the device specified by device id", + description = "Permanently Delete the device specified by device id", + key = "perm:devices:permanent-delete", + permissions = {"/device-mgt/admin/devices/permanent-delete"} ) } ) @@ -225,4 +247,72 @@ public interface DeviceManagementAdminService { value = "List of device identifiers.", required = true) List deviceIdentifiers); + + @DELETE + @Path("/type/{device-type}/id/{device-id}") + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + consumes = MediaType.APPLICATION_JSON, + httpMethod = "DELETE", + value = "Permanently remove the Device Specified by the Device ID", + notes = "Returns the status of the permanently deleted device operation and the details of the deleted device.", + tags = "Device Management", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:permanent-delete") + }) + } + ) + @ApiResponses( + value = { + @ApiResponse( + code = 200, + message = "OK. \n Successfully deleted the device permanently.", + response = Device.class, + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body"), + @ResponseHeader( + name = "ETag", + description = "Entity Tag of the response resource.\n" + + "Used by caches, or in conditional requests."), + @ResponseHeader( + name = "Last-Modified", + description = "Date and time the resource has been modified the last time.\n" + + "Used by caches, or in conditional requests."), + }), + @ApiResponse( + code = 304, + message = "Not Modified. Empty body because the client already has the latest " + + "version of the requested resource."), + @ApiResponse( + code = 400, + message = "Bad Request. \n Invalid request or validation error.", + response = ErrorResponse.class), + @ApiResponse( + code = 404, + message = "Not Found. \n No device is found under the provided type and id.", + response = ErrorResponse.class), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n " + + "Server error occurred while retrieving information requested device.", + response = ErrorResponse.class) + }) + Response deleteDevicePermanently( + @ApiParam( + name = "device-type", + value = "The device type, such as ios, android, or windows.", + required = true) + @PathParam("device-type") + @Size(max = 45) + String deviceType, + @ApiParam( + name = "device-id", + value = "The device identifier of the device.", + required = true) + @PathParam("device-id") + @Size(max = 45) + String deviceId); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 2e7aeb9e53f..33cf2ec35be 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -105,7 +105,6 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Map; @Path("/devices") @Produces(MediaType.APPLICATION_JSON) @@ -326,8 +325,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @Override @Path("/type/{device-type}/id/{device-id}") public Response deleteDevice(@PathParam("device-type") String deviceType, - @PathParam("device-id") String deviceId, - @QueryParam("permanentDelete") boolean permanentDelete) { + @PathParam("device-id") String deviceId) { DeviceManagementProviderService deviceManagementProviderService = DeviceMgtAPIUtils.getDeviceManagementService(); try { @@ -336,16 +334,8 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { if (persistedDevice == null) { return Response.status(Response.Status.NOT_FOUND).build(); } - - boolean response; - - if (permanentDelete) { - response = deviceManagementProviderService.deleteDevice(deviceIdentifier); - } else { - response = deviceManagementProviderService.disenrollDevice(deviceIdentifier); - } + boolean response = deviceManagementProviderService.disenrollDevice(deviceIdentifier); return Response.status(Response.Status.OK).entity(response).build(); - } catch (DeviceManagementException e) { String msg = "Error encountered while deleting device of type : " + deviceType + " and " + "ID : " + deviceId; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java index ecae28ff4f7..d3d0fe194c5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java @@ -15,28 +15,43 @@ * specific language governing permissions and limitations * under the License. * + * + * Copyright (c) 2019, Entgra (pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.jaxrs.service.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.solr.common.StringUtils; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.StringUtil; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.UserNotFoundException; +import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceList; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.service.api.admin.DeviceManagementAdminService; import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil; import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; -import javax.validation.constraints.Past; import javax.validation.constraints.Size; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -120,4 +135,28 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); } } + + @DELETE + @Override + @Path("/type/{device-type}/id/{device-id}") + public Response deleteDevicePermanently(@PathParam("device-type") String deviceType, + @PathParam("device-id") String deviceId) { + DeviceManagementProviderService deviceManagementProviderService = + DeviceMgtAPIUtils.getDeviceManagementService(); + try { + DeviceIdentifier deviceIdentifier = new DeviceIdentifier(deviceId, deviceType); + Device persistedDevice = deviceManagementProviderService.getDevice(deviceIdentifier, true); + if (persistedDevice == null) { + return Response.status(Response.Status.NOT_FOUND).build(); + } + boolean response = deviceManagementProviderService.deleteDevice(deviceIdentifier); + return Response.status(Response.Status.OK).entity(response).build(); + } catch (DeviceManagementException e) { + String msg = "Error encountered while permanently deleting device of type : " + deviceType + " and " + + "ID : " + deviceId; + log.error(msg, e); + return Response.status(Response.Status.BAD_REQUEST) + .entity(new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java index 6b923ba7757..fc26189f409 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImplTest.java @@ -481,8 +481,7 @@ public class DeviceManagementServiceImplTest { public void testDeleteDevice() { PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService")) .toReturn(this.deviceManagementProviderService); - Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString() - , false); + Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString()); Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); } @@ -492,8 +491,7 @@ public class DeviceManagementServiceImplTest { .toReturn(this.deviceManagementProviderService); Mockito.when(this.deviceManagementProviderService .getDevice(Mockito.any(DeviceIdentifier.class), Mockito.anyBoolean())).thenReturn(null); - Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString() - , false); + Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString()); Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); Mockito.reset(this.deviceManagementProviderService); } @@ -504,8 +502,7 @@ public class DeviceManagementServiceImplTest { .toReturn(this.deviceManagementProviderService); Mockito.when(this.deviceManagementProviderService.disenrollDevice(Mockito.any(DeviceIdentifier.class))) .thenThrow(new DeviceManagementException()); - Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString() - , false); + Response response = this.deviceManagementService.deleteDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString()); Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode()); Mockito.reset(this.deviceManagementProviderService); } From 1cf86ee95888572f89e10780342fdb7952ba9560 Mon Sep 17 00:00:00 2001 From: Milan Perera Date: Thu, 15 Aug 2019 17:08:45 +0200 Subject: [PATCH 12/27] Remove additional HTTP call from mssl handler This fixes the entgra/product-iots#128 --- .../handlers/AuthenticationHandler.java | 13 +++----- .../carbon/apimgt/handlers/utils/Utils.java | 32 +++---------------- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java index 8bad3de1a89..5638f3ba580 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java @@ -95,7 +95,7 @@ public class AuthenticationHandler extends AbstractHandler { log.debug("Verify Cert:\n" + mdmSignature); } URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + "ios"); - Map certVerifyHeaders = this.setHeaders(this.restInvoker); + Map certVerifyHeaders = this.setHeaders(); Certificate certificate = new Certificate(); certificate.setPem(mdmSignature); @@ -127,7 +127,7 @@ public class AuthenticationHandler extends AbstractHandler { String deviceType = this.getDeviceType(messageContext.getTo().getAddress().trim()); URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + deviceType); - Map certVerifyHeaders = this.setHeaders(this.restInvoker); + Map certVerifyHeaders = this.setHeaders(); Certificate certificate = new Certificate(); certificate.setPem(subjectDN); certificate.setTenantId(tenantId); @@ -157,7 +157,7 @@ public class AuthenticationHandler extends AbstractHandler { } String deviceType = this.getDeviceType(messageContext.getTo().getAddress().trim()); URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + deviceType); - Map certVerifyHeaders = this.setHeaders(this.restInvoker); + Map certVerifyHeaders = this.setHeaders(); Certificate certificate = new Certificate(); certificate.setPem(encodedPem); @@ -184,9 +184,6 @@ public class AuthenticationHandler extends AbstractHandler { } catch (URISyntaxException e) { log.error("Error while processing certificate.", e); return false; - } catch (APIMCertificateMGTException e) { - log.error("Error while processing certificate.", e); - return false; } catch (CertificateException e) { log.error("Certificate issue occurred when generating converting PEM to x509Certificate", e); return false; @@ -212,9 +209,9 @@ public class AuthenticationHandler extends AbstractHandler { return null; } - private Map setHeaders(RESTInvoker restInvoker) throws APIMCertificateMGTException { + private Map setHeaders() { Map map = new HashMap<>(); - String accessToken = Utils.getAccessToken(iotServerConfiguration, restInvoker); + String accessToken = Utils.getBase64EncodedToken(iotServerConfiguration); map.put(AUTHORIZATION, BEARER + accessToken); map.put(CONTENT_TYPE, "application/json"); return map; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java index f149868e760..5be2c187054 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java @@ -135,38 +135,14 @@ public class Utils { } /** - * This class get the access token from the key manager. + * This method is used to get the base64 encoded token. * * @param iotServerConfiguration Instance of the IoTsererConfiguration. * @return Access token will be returned. - * @throws APIMCertificateMGTException */ - public static String getAccessToken(IOTServerConfiguration iotServerConfiguration, RESTInvoker restInvoker) - throws APIMCertificateMGTException { - try { - if (clientId == null || clientSecret == null) { - getClientSecretes(iotServerConfiguration, restInvoker); - } - URI tokenUrl = new URI(iotServerConfiguration.getOauthTokenEndpoint()); - String tokenContent = "grant_type=password&username=" + iotServerConfiguration.getUsername() + "&password=" + - iotServerConfiguration.getPassword() + "&scope=activity-view"; - String tokenBasicAuth = "Basic " + Base64.encode((clientId + ":" + clientSecret).getBytes()); - Map tokenHeaders = new HashMap<>(); - tokenHeaders.put("Authorization", tokenBasicAuth); - tokenHeaders.put("Content-Type", "application/x-www-form-urlencoded"); - - RESTResponse response = restInvoker.invokePOST(tokenUrl, tokenHeaders, tokenContent); - if (log.isDebugEnabled()) { - log.debug("Token response:" + response.getContent()); - } - JSONObject jsonResponse = new JSONObject(response.getContent()); - return jsonResponse.getString("access_token"); - - } catch (URISyntaxException | IOException e) { - throw new APIMCertificateMGTException("Error occurred while trying to call oauth token endpoint", e); - } catch (JSONException e) { - throw new APIMCertificateMGTException("Error occurred while converting the json to object", e); - } + public static String getBase64EncodedToken(IOTServerConfiguration iotServerConfiguration) { + return Base64.encode((iotServerConfiguration.getUsername() + ":" + iotServerConfiguration.getPassword()). + getBytes()); } /** From b7757a65ce8e424cce3884a4dc2456e1b2170f84 Mon Sep 17 00:00:00 2001 From: Milan Perera Date: Thu, 15 Aug 2019 20:49:14 +0200 Subject: [PATCH 13/27] Enable basic authentication in cert-mgt webapp --- .../src/main/webapp/WEB-INF/web.xml | 4 ++++ .../src/main/webapp/WEB-INF/web.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml index 6fd45f33b32..9722ee843e1 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml @@ -37,6 +37,10 @@ doAuthentication true + + basicAuth + true + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/webapp/WEB-INF/web.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/webapp/WEB-INF/web.xml index 9c7b5bea475..d642acfffaf 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/webapp/WEB-INF/web.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/webapp/WEB-INF/web.xml @@ -41,6 +41,10 @@ isDefault false + + basicAuth + true + From 439ce4f1ece64dcf6b6ef190fa0639a8e6aa95a8 Mon Sep 17 00:00:00 2001 From: Milan Perera Date: Thu, 15 Aug 2019 22:23:46 +0200 Subject: [PATCH 14/27] Fix apim handler test failures --- .../wso2/carbon/apimgt/handlers/AuthenticationHandler.java | 2 +- .../carbon/apimgt/handlers/AuthenticationHandlerTest.java | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java index 5638f3ba580..06d344a5140 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java @@ -55,7 +55,7 @@ public class AuthenticationHandler extends AbstractHandler { private static final String X_JWT_ASSERTION = "X-JWT-Assertion"; private static final String JWTTOKEN = "JWTToken"; private static final String AUTHORIZATION = "Authorization"; - private static final String BEARER = "Bearer "; + private static final String BEARER = "Basic "; private static final String CONTENT_TYPE = "Content-Type"; private IOTServerConfiguration iotServerConfiguration; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java index b3b8cdac781..23e6b251fcf 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java @@ -92,8 +92,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest { HashMap transportHeaders = new HashMap<>(); transportHeaders.put(AuthConstants.MDM_SIGNATURE, "some cert"); setMockClient(); - this.mockClient.setResponse(getDCRResponse()); - this.mockClient.setResponse(getAccessTokenReponse()); this.mockClient.setResponse(getValidationResponse()); boolean response = this.handler.handleRequest(createSynapseMessageContext("", this.synapseConfiguration, transportHeaders, "https://test.com/testservice/device-mgt/testdevice")); @@ -107,7 +105,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest { HashMap transportHeaders = new HashMap<>(); transportHeaders.put(AuthConstants.PROXY_MUTUAL_AUTH_HEADER, "Test Header"); setMockClient(); - this.mockClient.setResponse(getAccessTokenReponse()); this.mockClient.setResponse(getValidationResponse()); boolean response = this.handler.handleRequest(createSynapseMessageContext("", this.synapseConfiguration, transportHeaders, "https://test.com/testservice/device-mgt/testdevice")); @@ -121,7 +118,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest { HashMap transportHeaders = new HashMap<>(); transportHeaders.put(AuthConstants.MUTUAL_AUTH_HEADER, "Test Header"); setMockClient(); - this.mockClient.setResponse(getAccessTokenReponse()); this.mockClient.setResponse(getValidationResponse()); MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); @@ -141,7 +137,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest { HashMap transportHeaders = new HashMap<>(); transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem"); setMockClient(); - this.mockClient.setResponse(getAccessTokenReponse()); this.mockClient.setResponse(getValidationResponse()); MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); @@ -156,7 +151,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest { HashMap transportHeaders = new HashMap<>(); transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem"); setMockClient(); - this.mockClient.setResponse(getAccessTokenReponse()); this.mockClient.setResponse(getInvalidResponse()); MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); @@ -185,7 +179,6 @@ public class AuthenticationHandlerTest extends BaseAPIHandlerTest { HashMap transportHeaders = new HashMap<>(); transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem"); setMockClient(); - this.mockClient.setResponse(getAccessTokenReponse()); this.mockClient.setResponse(null); MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); From dd4a31beb70f54b41e7b7a70ce0b6129947ddf93 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Fri, 16 Aug 2019 13:49:49 +0530 Subject: [PATCH 15/27] Log and set message in response whend device not found to delete --- .../impl/admin/DeviceManagementAdminServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java index d3d0fe194c5..4a2fb4f25d8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java @@ -147,7 +147,11 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe DeviceIdentifier deviceIdentifier = new DeviceIdentifier(deviceId, deviceType); Device persistedDevice = deviceManagementProviderService.getDevice(deviceIdentifier, true); if (persistedDevice == null) { - return Response.status(Response.Status.NOT_FOUND).build(); + String msg = "No device found with the device type: " + deviceType + + " having the device ID: " + deviceId + " to permanently delete."; + log.error(msg); + return Response.status(Response.Status.NOT_FOUND).entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } boolean response = deviceManagementProviderService.deleteDevice(deviceIdentifier); return Response.status(Response.Status.OK).entity(response).build(); @@ -155,8 +159,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe String msg = "Error encountered while permanently deleting device of type : " + deviceType + " and " + "ID : " + deviceId; log.error(msg, e); - return Response.status(Response.Status.BAD_REQUEST) - .entity(new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + return Response.status(Response.Status.BAD_REQUEST).entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } } } From 5271fc41635e80c6fb3bbb4a8f182842ae5165e9 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 1 Aug 2019 17:57:44 +0530 Subject: [PATCH 16/27] Add device type extension config --- .../DeviceTypeManagerExtensionConfig.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java new file mode 100644 index 00000000000..5cd564367a7 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java @@ -0,0 +1,19 @@ +package org.wso2.carbon.device.mgt.extensions.device.type.template.config; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "DeviceTypeManagerExtensionConfig") +public class DeviceTypeManagerExtensionConfig { + + private String extensionClass; + + @XmlElement(name = "ExtensionClass", required = true) + public String getExtensionClass() { + return extensionClass; + } + + public void setExtensionClass(String extensionClass) { + this.extensionClass = extensionClass; + } +} From f1c6ee70685ec9bdf61814835ea1c4cc2d2d0f07 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 1 Aug 2019 17:58:05 +0530 Subject: [PATCH 17/27] Add interface for device type plugin dao --- .../DeviceTypeManagerExtensionService.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java new file mode 100644 index 00000000000..41555235958 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.device.mgt.extensions.spi; + +import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceTypePluginDAOManager; + +public interface DeviceTypeManagerExtensionService { + + void setDeviceTypePluginDAOManager(DeviceTypePluginDAOManager deviceManager); +} From 9d81ee6cb40531583caeabf3aba8409436b3888e Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 1 Aug 2019 17:59:08 +0530 Subject: [PATCH 18/27] Expose device type extension dao plugin via device type deployer --- .../type/template/DeviceTypeManager.java | 32 +++++++++++++++++++ .../config/DeviceTypeConfiguration.java | 23 +++++++++++++ .../template/dao/DeviceTypeDAOHandler.java | 14 ++++++++ 3 files changed, 69 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java index 948e5a5ff63..fc331d82202 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java @@ -34,6 +34,7 @@ */ package org.wso2.carbon.device.mgt.extensions.device.type.template; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; @@ -48,9 +49,11 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager; +import org.wso2.carbon.device.mgt.extensions.spi.DeviceTypeManagerExtensionService; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DataSource; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DeviceDetails; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DeviceTypeConfiguration; +import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DeviceTypeManagerExtensionConfig; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.Feature; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.Table; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.TableConfig; @@ -213,6 +216,35 @@ public class DeviceTypeManager implements DeviceManager { } } } + setDeviceTypeManagerExtensionServices(deviceTypeConfiguration); + } + + private void setDeviceTypeManagerExtensionServices(DeviceTypeConfiguration deviceTypeConfiguration) { + DeviceTypeManagerExtensionConfig deviceTypeExtensionConfig = deviceTypeConfiguration.getDeviceTypeExtensionConfig(); + if (deviceTypeExtensionConfig != null) { + String extensionClass = deviceTypeExtensionConfig.getExtensionClass(); + if (StringUtils.isNotEmpty(extensionClass)) { + try { + Class clz = Class.forName(extensionClass); + DeviceTypeManagerExtensionService deviceTypeManagerExtensionService = (DeviceTypeManagerExtensionService) clz.newInstance(); + if (deviceTypePluginDAOManager != null) { + deviceTypeManagerExtensionService.setDeviceTypePluginDAOManager(deviceTypePluginDAOManager); + } + } catch (ClassNotFoundException e) { + String msg = "Extension class cannot be located"; + log.error(msg, e); + throw new DeviceTypeDeployerPayloadException(msg, e); + } catch (IllegalAccessException e) { + String msg = "Cannot access the class or its constructor is not accessible."; + log.error(msg, e); + throw new DeviceTypeDeployerPayloadException(msg, e); + } catch (InstantiationException e) { + String msg = "Extension class instantiation is failed"; + log.error(msg, e); + throw new DeviceTypeDeployerPayloadException(msg, e); + } + } + } } @Override diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java index b1ba2d8fe8b..568aa5ae73a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java @@ -105,6 +105,8 @@ public class DeviceTypeConfiguration { @XmlElementWrapper(name = "StartupOperationConfig") @XmlElement(name = "Operation", required = true) protected List startupOperations; + @XmlElement(name = "DeviceTypeManagerExtensionConfig") + private DeviceTypeManagerExtensionConfig deviceTypeExtensionConfig; public List getOperations() { return operations; @@ -402,4 +404,25 @@ public class DeviceTypeConfiguration { public void setStartupOperations(List startupOperations) { this.startupOperations = startupOperations; } + + /** + * Gets the value of DeviceTypeManagerExtensionConfig + * + * @return possible object is + * {@link DeviceTypeManagerExtensionConfig} + */ + public DeviceTypeManagerExtensionConfig getDeviceTypeExtensionConfig() { + return deviceTypeExtensionConfig; + } + + /** + * Sets the value for DeviceTypeManagerExtensionConfig + * + * @param deviceTypeExtensionConfig possible object is + * {@link DeviceTypeManagerExtensionConfig} + */ + public void setDeviceTypeExtensionConfig( + DeviceTypeManagerExtensionConfig deviceTypeExtensionConfig) { + this.deviceTypeExtensionConfig = deviceTypeExtensionConfig; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java index e31149fafe9..b37eca5f853 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java @@ -2,6 +2,7 @@ package org.wso2.carbon.device.mgt.extensions.device.type.template.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.IllegalTransactionStateException; import org.wso2.carbon.device.mgt.extensions.device.type.template.exception.DeviceTypeDeployerPayloadException; import org.wso2.carbon.device.mgt.extensions.device.type.template.exception.DeviceTypeMgtPluginException; @@ -35,6 +36,19 @@ public class DeviceTypeDAOHandler { } } + public void openConnection() throws DeviceTypeMgtPluginException { + try { + Connection conn = currentConnection.get(); + if (conn != null) { + throw new IllegalTransactionStateException("Database connection has already been obtained."); + } + conn = dataSource.getConnection(); + currentConnection.set(conn); + } catch (SQLException e) { + throw new DeviceTypeMgtPluginException("Failed to get a database connection.", e); + } + } + public void beginTransaction() throws DeviceTypeMgtPluginException { try { Connection conn = dataSource.getConnection(); From 0d203e0cd598b504a4a120fcc3359270f48c736f Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 8 Aug 2019 16:38:33 +0530 Subject: [PATCH 19/27] Set device type plugin DAO manager in hashmap --- .../type/template/DeviceTypeManager.java | 108 +++++------------- .../DeviceTypeManagerExtensionService.java | 26 ----- 2 files changed, 29 insertions(+), 105 deletions(-) delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java index fc331d82202..1551d302b71 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java @@ -49,11 +49,9 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager; -import org.wso2.carbon.device.mgt.extensions.spi.DeviceTypeManagerExtensionService; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DataSource; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DeviceDetails; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DeviceTypeConfiguration; -import org.wso2.carbon.device.mgt.extensions.device.type.template.config.DeviceTypeManagerExtensionConfig; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.Feature; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.Table; import org.wso2.carbon.device.mgt.extensions.device.type.template.config.TableConfig; @@ -65,6 +63,7 @@ import org.wso2.carbon.device.mgt.extensions.device.type.template.feature.Config import org.wso2.carbon.device.mgt.extensions.device.type.template.util.DeviceTypePluginConstants; import org.wso2.carbon.device.mgt.extensions.device.type.template.util.DeviceTypeUtils; import org.wso2.carbon.device.mgt.extensions.license.mgt.registry.RegistryBasedLicenseManager; +import org.wso2.carbon.device.mgt.extensions.spi.DeviceTypePluginExtensionService; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.utils.CarbonUtils; @@ -216,34 +215,18 @@ public class DeviceTypeManager implements DeviceManager { } } } - setDeviceTypeManagerExtensionServices(deviceTypeConfiguration); + setDeviceTypePluginManager(); } - private void setDeviceTypeManagerExtensionServices(DeviceTypeConfiguration deviceTypeConfiguration) { - DeviceTypeManagerExtensionConfig deviceTypeExtensionConfig = deviceTypeConfiguration.getDeviceTypeExtensionConfig(); - if (deviceTypeExtensionConfig != null) { - String extensionClass = deviceTypeExtensionConfig.getExtensionClass(); - if (StringUtils.isNotEmpty(extensionClass)) { - try { - Class clz = Class.forName(extensionClass); - DeviceTypeManagerExtensionService deviceTypeManagerExtensionService = (DeviceTypeManagerExtensionService) clz.newInstance(); - if (deviceTypePluginDAOManager != null) { - deviceTypeManagerExtensionService.setDeviceTypePluginDAOManager(deviceTypePluginDAOManager); - } - } catch (ClassNotFoundException e) { - String msg = "Extension class cannot be located"; - log.error(msg, e); - throw new DeviceTypeDeployerPayloadException(msg, e); - } catch (IllegalAccessException e) { - String msg = "Cannot access the class or its constructor is not accessible."; - log.error(msg, e); - throw new DeviceTypeDeployerPayloadException(msg, e); - } catch (InstantiationException e) { - String msg = "Extension class instantiation is failed"; - log.error(msg, e); - throw new DeviceTypeDeployerPayloadException(msg, e); - } - } + /** + * Set device type plugin DAO manager of each device type in a HashMap which can then be used via individual + * device type plugin in working with its DAO components + */ + private void setDeviceTypePluginManager() { + if (StringUtils.isNotEmpty(deviceType) && deviceTypePluginDAOManager != null) { + DeviceTypePluginExtensionService deviceTypeManagerExtensionService = + new DeviceTypePluginExtensionServiceImpl(); + deviceTypeManagerExtensionService.addPluginDAOManager(deviceType, deviceTypePluginDAOManager); } } @@ -339,15 +322,11 @@ public class DeviceTypeManager implements DeviceManager { deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); } } catch (DeviceTypeMgtPluginException e) { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); - } catch (DeviceTypeMgtPluginException ex) { - String msg = "Error occurred while roll back the device enrol transaction :" + - device.toString(); - log.warn(msg, ex); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); String msg = "Error while enrolling the " + deviceType + " device : " + device.getDeviceIdentifier(); throw new DeviceManagementException(msg, e); + } finally { + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } return status; } @@ -366,16 +345,12 @@ public class DeviceTypeManager implements DeviceManager { status = deviceTypePluginDAOManager.getDeviceDAO().updateDevice(device); deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); } catch (DeviceTypeMgtPluginException e) { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); - } catch (DeviceTypeMgtPluginException mobileDAOEx) { - String msg = "Error occurred while roll back the update device transaction :" + - device.toString(); - log.warn(msg, mobileDAOEx); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); String msg = "Error while updating the enrollment of the " + deviceType + " device : " + device.getDeviceIdentifier(); throw new DeviceManagementException(msg, e); + } finally { + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } return status; } @@ -410,13 +385,7 @@ public class DeviceTypeManager implements DeviceManager { deviceId.getId(); throw new DeviceManagementException(msg, e); } finally { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); - } catch (DeviceTypeMgtPluginException e) { - String msg = "Error occurred while closing the transaction to check device " + - deviceId.getId() + " is enrolled."; - log.warn(msg, e); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } return isEnrolled; } @@ -451,12 +420,7 @@ public class DeviceTypeManager implements DeviceManager { throw new DeviceManagementException( "Error occurred while fetching the " + deviceType + " device: '" + deviceId.getId() + "'", e); } finally { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); - } catch (DeviceTypeMgtPluginException e) { - String msg = "Error occurred while closing the transaction to get device " + deviceId.getId(); - log.warn(msg, e); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } return device; } @@ -479,14 +443,11 @@ public class DeviceTypeManager implements DeviceManager { status = deviceTypePluginDAOManager.getDeviceDAO().updateDevice(updatedDevice); deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); } catch (DeviceTypeMgtPluginException e) { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); - } catch (DeviceTypeMgtPluginException transactionException) { - String msg = "Error occurred while rolling back transaction for device: " + deviceId.getId(); - log.warn(msg, transactionException); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); throw new DeviceManagementException( "Error occurred while fetching the " + deviceType + " device: '" + deviceId.getId() + "'", e); + } finally { + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } } return status; @@ -576,15 +537,12 @@ public class DeviceTypeManager implements DeviceManager { status = deviceTypePluginDAOManager.getDeviceDAO().updateDevice(existingDevice); deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); } catch (DeviceTypeMgtPluginException e) { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); - } catch (DeviceTypeMgtPluginException e1) { - log.warn("Error occurred while roll back the update device info transaction : '" + - device.toString() + "'", e1); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); throw new DeviceManagementException( "Error occurred while updating the " + deviceType + " device: '" + device.getDeviceIdentifier() + "'", e); + } finally { + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } return status; } @@ -604,12 +562,7 @@ public class DeviceTypeManager implements DeviceManager { } catch (DeviceTypeMgtPluginException e) { throw new DeviceManagementException("Error occurred while fetching all " + deviceType + " devices", e); } finally { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); - } catch (DeviceTypeMgtPluginException e) { - String msg = "Error occurred while closing the transaction to get all devices."; - log.warn(msg, e); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } return devices; } @@ -632,15 +585,12 @@ public class DeviceTypeManager implements DeviceManager { status = deviceTypePluginDAOManager.getDeviceDAO().deleteDevice(existingDevice); deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); } catch (DeviceTypeMgtPluginException e) { - try { - deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); - } catch (DeviceTypeMgtPluginException e1) { - log.warn("Error occurred while roll back the delete device info transaction : '" + - device.toString() + "'", e1); - } + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); throw new DeviceManagementException( "Error occurred while deleting the " + deviceType + " device: '" + device.getDeviceIdentifier() + "'", e); + } finally { + deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } return status; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java deleted file mode 100644 index 41555235958..00000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypeManagerExtensionService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. - * - * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.device.mgt.extensions.spi; - -import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceTypePluginDAOManager; - -public interface DeviceTypeManagerExtensionService { - - void setDeviceTypePluginDAOManager(DeviceTypePluginDAOManager deviceManager); -} From f0103f27c4cb70447a17e7157eb2836f2c84fd18 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 8 Aug 2019 16:39:18 +0530 Subject: [PATCH 20/27] Modify error messages and exception handling --- .../template/dao/DeviceTypeDAOHandler.java | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java index b37eca5f853..6347aa136ed 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java @@ -70,25 +70,21 @@ public class DeviceTypeDAOHandler { return currentConnection.get(); } - public void commitTransaction() throws DeviceTypeMgtPluginException { + public void commitTransaction() { + Connection conn = currentConnection.get(); + if (conn == null) { + throw new IllegalStateException("No connection is associated with the current transaction. " + + "This might have ideally been caused by not properly initiating the " + + "transaction via 'beginTransaction'/'openConnection' methods"); + } try { - Connection conn = currentConnection.get(); - if (conn != null) { - conn.commit(); - } else { - if (log.isDebugEnabled()) { - log.debug("Datasource connection associated with the current thread is null, hence commit " - + "has not been attempted"); - } - } + conn.commit(); } catch (SQLException e) { - throw new DeviceTypeMgtPluginException("Error occurred while committing the transaction", e); - } finally { - closeConnection(); + log.error("Error occurred while committing the transaction.", e); } } - public void closeConnection() throws DeviceTypeMgtPluginException { + public void closeConnection() { Connection con = currentConnection.get(); if (con != null) { @@ -101,21 +97,17 @@ public class DeviceTypeDAOHandler { currentConnection.remove(); } - public void rollbackTransaction() throws DeviceTypeMgtPluginException { + public void rollbackTransaction() { + Connection conn = currentConnection.get(); + if (conn == null) { + throw new IllegalStateException("No connection is associated with the current transaction. " + + "This might have ideally been caused by not properly initiating the " + + "transaction via 'beginTransaction'/'openConnection' methods"); + } try { - Connection conn = currentConnection.get(); - if (conn != null) { - conn.rollback(); - } else { - if (log.isDebugEnabled()) { - log.debug("Datasource connection associated with the current thread is null, hence rollback " - + "has not been attempted"); - } - } + conn.rollback(); } catch (SQLException e) { - throw new DeviceTypeMgtPluginException("Error occurred while rollback the transaction", e); - } finally { - closeConnection(); + log.error("Error occurred while roll-backing the transaction.", e); } } } From 42b092d43ae9a06df12d3add14e14c6177a7d177 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 8 Aug 2019 16:41:37 +0530 Subject: [PATCH 21/27] Add license header for DeviceTypeDAOHandler --- .../type/template/dao/DeviceTypeDAOHandler.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java index 6347aa136ed..edbbba52c67 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2019, Entgra (Pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.device.mgt.extensions.device.type.template.dao; import org.apache.commons.logging.Log; From c5b46415971024f30fe54bc7fe76953a943961a9 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 8 Aug 2019 16:50:55 +0530 Subject: [PATCH 22/27] Add the interface of DeviceTypePluginExtensionService --- .../spi/DeviceTypePluginExtensionService.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java new file mode 100644 index 00000000000..3c57300cec2 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019, Entgra (Pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.extensions.spi; + +import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceTypePluginDAOManager; + +/** + * This represents the device type plugin extension service which can be used by any device type plugin implementation + * intended to use the same plugin DAO instances to be used with its plugin level DAO components + */ +public interface DeviceTypePluginExtensionService { + + /** + * Save device type specific pluginDAOManager in a HashMap + * @param deviceType - Type of the device (i.e; android, ios, windows) + * @param pluginDAOManager - Device type plugin DAO manager instance to be saved against device type + */ + void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager); + + /** + * Retrieve the DeviceTypePluginDAOManager instance given the device type + * @param deviceType - Type of the device (i.e; android, ios, windows) + * @return an Instance of {@link DeviceTypePluginDAOManager} + */ + DeviceTypePluginDAOManager getPluginDAOManager(String deviceType); +} From b9bceadec88d582711eedc037359155de2799915 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 8 Aug 2019 16:51:21 +0530 Subject: [PATCH 23/27] Add the implementation of DeviceTypePluginExtensionService --- .../DeviceTypePluginExtensionServiceImpl.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java new file mode 100644 index 00000000000..4ccaeadb604 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019, Entgra (Pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.extensions.device.type.template; + +import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceTypePluginDAOManager; +import org.wso2.carbon.device.mgt.extensions.spi.DeviceTypePluginExtensionService; + +import java.util.HashMap; +import java.util.Map; + +public class DeviceTypePluginExtensionServiceImpl implements DeviceTypePluginExtensionService { + + private static volatile Map pluginDAOManagers = new HashMap<>(); + + @Override + public void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager) { + if (pluginDAOManager != null) { + if (!pluginDAOManagers.containsKey(deviceType)) { + pluginDAOManagers.put(deviceType, pluginDAOManager); + } + } + } + + @Override + public DeviceTypePluginDAOManager getPluginDAOManager(String deviceType) { + return pluginDAOManagers.get(deviceType); + } +} From a246c16eb616aa2c8339e8037976e851c722c5a8 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 8 Aug 2019 16:53:28 +0530 Subject: [PATCH 24/27] Register DeviceTypePluginExtensionService --- .../DeviceTypeExtensionServiceComponent.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/internal/DeviceTypeExtensionServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/internal/DeviceTypeExtensionServiceComponent.java index e29af46f125..36ae9b11dc1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/internal/DeviceTypeExtensionServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/internal/DeviceTypeExtensionServiceComponent.java @@ -14,6 +14,23 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. + * + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (https://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.device.mgt.extensions.internal; @@ -23,6 +40,8 @@ import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; import org.wso2.carbon.device.mgt.common.spi.DeviceTypeGeneratorService; import org.wso2.carbon.device.mgt.extensions.device.type.template.DeviceTypeGeneratorServiceImpl; +import org.wso2.carbon.device.mgt.extensions.device.type.template.DeviceTypePluginExtensionServiceImpl; +import org.wso2.carbon.device.mgt.extensions.spi.DeviceTypePluginExtensionService; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.registry.core.service.RegistryService; @@ -50,6 +69,8 @@ public class DeviceTypeExtensionServiceComponent { } ctx.getBundleContext() .registerService(DeviceTypeGeneratorService.class, new DeviceTypeGeneratorServiceImpl(), null); + ctx.getBundleContext().registerService(DeviceTypePluginExtensionService.class, + new DeviceTypePluginExtensionServiceImpl(), null); if (log.isDebugEnabled()) { log.debug("Device Type Extension Service Component successfully activated"); } From d6d91e4bc2f40e95c5055f2fea0b843cf70baa06 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Sat, 10 Aug 2019 23:11:08 +0530 Subject: [PATCH 25/27] Remove retrieving device type extension class from deployer file --- .../config/DeviceTypeConfiguration.java | 23 ------------------- .../DeviceTypeManagerExtensionConfig.java | 19 --------------- 2 files changed, 42 deletions(-) delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java index 568aa5ae73a..b1ba2d8fe8b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeConfiguration.java @@ -105,8 +105,6 @@ public class DeviceTypeConfiguration { @XmlElementWrapper(name = "StartupOperationConfig") @XmlElement(name = "Operation", required = true) protected List startupOperations; - @XmlElement(name = "DeviceTypeManagerExtensionConfig") - private DeviceTypeManagerExtensionConfig deviceTypeExtensionConfig; public List getOperations() { return operations; @@ -404,25 +402,4 @@ public class DeviceTypeConfiguration { public void setStartupOperations(List startupOperations) { this.startupOperations = startupOperations; } - - /** - * Gets the value of DeviceTypeManagerExtensionConfig - * - * @return possible object is - * {@link DeviceTypeManagerExtensionConfig} - */ - public DeviceTypeManagerExtensionConfig getDeviceTypeExtensionConfig() { - return deviceTypeExtensionConfig; - } - - /** - * Sets the value for DeviceTypeManagerExtensionConfig - * - * @param deviceTypeExtensionConfig possible object is - * {@link DeviceTypeManagerExtensionConfig} - */ - public void setDeviceTypeExtensionConfig( - DeviceTypeManagerExtensionConfig deviceTypeExtensionConfig) { - this.deviceTypeExtensionConfig = deviceTypeExtensionConfig; - } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java deleted file mode 100644 index 5cd564367a7..00000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/config/DeviceTypeManagerExtensionConfig.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.wso2.carbon.device.mgt.extensions.device.type.template.config; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "DeviceTypeManagerExtensionConfig") -public class DeviceTypeManagerExtensionConfig { - - private String extensionClass; - - @XmlElement(name = "ExtensionClass", required = true) - public String getExtensionClass() { - return extensionClass; - } - - public void setExtensionClass(String extensionClass) { - this.extensionClass = extensionClass; - } -} From 0c7843f2fe8512e6c5c287d2e4c11d4df18b6dc2 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Tue, 13 Aug 2019 18:40:10 +0530 Subject: [PATCH 26/27] Modify logic of saving DeviceTypePluginDAOManager to support multi tenancy --- .../type/template/DeviceTypeManager.java | 18 +++++++++--- .../DeviceTypePluginExtensionServiceImpl.java | 29 +++++++++++++++++-- .../DeviceTypePluginExtensionException.java | 12 ++++++++ .../spi/DeviceTypePluginExtensionService.java | 4 +-- 4 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java index 1551d302b71..1169d7eebfd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java @@ -59,6 +59,7 @@ import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceDAOD import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceTypePluginDAOManager; import org.wso2.carbon.device.mgt.extensions.device.type.template.exception.DeviceTypeDeployerPayloadException; import org.wso2.carbon.device.mgt.extensions.device.type.template.exception.DeviceTypeMgtPluginException; +import org.wso2.carbon.device.mgt.extensions.device.type.template.exception.DeviceTypePluginExtensionException; import org.wso2.carbon.device.mgt.extensions.device.type.template.feature.ConfigurationBasedFeatureManager; import org.wso2.carbon.device.mgt.extensions.device.type.template.util.DeviceTypePluginConstants; import org.wso2.carbon.device.mgt.extensions.device.type.template.util.DeviceTypeUtils; @@ -223,10 +224,19 @@ public class DeviceTypeManager implements DeviceManager { * device type plugin in working with its DAO components */ private void setDeviceTypePluginManager() { - if (StringUtils.isNotEmpty(deviceType) && deviceTypePluginDAOManager != null) { - DeviceTypePluginExtensionService deviceTypeManagerExtensionService = - new DeviceTypePluginExtensionServiceImpl(); - deviceTypeManagerExtensionService.addPluginDAOManager(deviceType, deviceTypePluginDAOManager); + if (StringUtils.isNotEmpty(deviceType)) { + if (deviceTypePluginDAOManager != null) { + DeviceTypePluginExtensionService deviceTypeManagerExtensionService = + new DeviceTypePluginExtensionServiceImpl(); + deviceTypeManagerExtensionService.addPluginDAOManager(deviceType, deviceTypePluginDAOManager); + } else { + log.warn("Could not save DeviceTypePluginDAOManager for device type: " + deviceType + + " since DeviceTypePluginDAOManager is null."); + } + } else { + String msg = "Could not save DeviceTypePluginDAOManager since device type is null or empty."; + log.error(msg); + throw new DeviceTypePluginExtensionException(msg); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java index 4ccaeadb604..bfe01098b61 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java @@ -17,7 +17,11 @@ */ package org.wso2.carbon.device.mgt.extensions.device.type.template; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceTypePluginDAOManager; +import org.wso2.carbon.device.mgt.extensions.device.type.template.exception.DeviceTypePluginExtensionException; import org.wso2.carbon.device.mgt.extensions.spi.DeviceTypePluginExtensionService; import java.util.HashMap; @@ -25,19 +29,38 @@ import java.util.Map; public class DeviceTypePluginExtensionServiceImpl implements DeviceTypePluginExtensionService { + private static final Log log = LogFactory.getLog(DeviceTypePluginExtensionServiceImpl.class); + private static volatile Map pluginDAOManagers = new HashMap<>(); @Override public void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager) { + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); if (pluginDAOManager != null) { - if (!pluginDAOManagers.containsKey(deviceType)) { - pluginDAOManagers.put(deviceType, pluginDAOManager); + if (!pluginDAOManagers.containsKey(tenantId + deviceType)) { + if (log.isDebugEnabled()) { + log.debug("Saving DeviceTypePluginDAOManager against tenant id " + tenantId + + " and device type: " + deviceType); + } + pluginDAOManagers.put(tenantId + deviceType, pluginDAOManager); } } } @Override public DeviceTypePluginDAOManager getPluginDAOManager(String deviceType) { - return pluginDAOManagers.get(deviceType); + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); + if (pluginDAOManagers.containsKey(tenantId + deviceType)) { + if (log.isDebugEnabled()) { + log.debug("Retrieving DeviceTypePluginDAOManager against tenant id " + tenantId + + " and device type: " + deviceType); + } + return pluginDAOManagers.get(tenantId + deviceType); + } else { + String msg = "DeviceTypePluginDAOManager could not be found against tenant id " + tenantId + + " and device type: " + deviceType; + log.error(msg); + throw new DeviceTypePluginExtensionException(msg); + } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java new file mode 100644 index 00000000000..7afbd12cd2b --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java @@ -0,0 +1,12 @@ +package org.wso2.carbon.device.mgt.extensions.device.type.template.exception; + +public class DeviceTypePluginExtensionException extends RuntimeException { + + public DeviceTypePluginExtensionException(String msg) { + super(msg); + } + + public DeviceTypePluginExtensionException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java index 3c57300cec2..26aaf481e2d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java @@ -26,14 +26,14 @@ import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceType public interface DeviceTypePluginExtensionService { /** - * Save device type specific pluginDAOManager in a HashMap + * Save device type specific DeviceTypePluginDAOManager in a HashMap againast tenant ID and device type * @param deviceType - Type of the device (i.e; android, ios, windows) * @param pluginDAOManager - Device type plugin DAO manager instance to be saved against device type */ void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager); /** - * Retrieve the DeviceTypePluginDAOManager instance given the device type + * Retrieve the DeviceTypePluginDAOManager instance against tenant ID and given device type * @param deviceType - Type of the device (i.e; android, ios, windows) * @return an Instance of {@link DeviceTypePluginDAOManager} */ From 4a58aea2d05fc738eb9ca96c710889c7fdcb6758 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Mon, 19 Aug 2019 13:54:19 +0530 Subject: [PATCH 27/27] Handle exception and log error messages related to DeviceTypeDAOHandler --- .../type/template/DeviceTypeManager.java | 11 ++++- .../DeviceTypePluginExtensionServiceImpl.java | 23 ++++++---- .../template/dao/DeviceTypeDAOHandler.java | 46 +++++++++++++------ .../DeviceTypePluginExtensionException.java | 2 +- .../spi/DeviceTypePluginExtensionService.java | 8 +++- 5 files changed, 61 insertions(+), 29 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java index 1169d7eebfd..4e60210424f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java @@ -228,7 +228,14 @@ public class DeviceTypeManager implements DeviceManager { if (deviceTypePluginDAOManager != null) { DeviceTypePluginExtensionService deviceTypeManagerExtensionService = new DeviceTypePluginExtensionServiceImpl(); - deviceTypeManagerExtensionService.addPluginDAOManager(deviceType, deviceTypePluginDAOManager); + try { + deviceTypeManagerExtensionService.addPluginDAOManager(deviceType, deviceTypePluginDAOManager); + } catch (DeviceTypePluginExtensionException e) { + String msg = "Error occurred while saving DeviceTypePluginDAOManager for device type: " + + deviceType; + log.error(msg); + throw new DeviceTypeDeployerPayloadException(msg); + } } else { log.warn("Could not save DeviceTypePluginDAOManager for device type: " + deviceType + " since DeviceTypePluginDAOManager is null."); @@ -236,7 +243,7 @@ public class DeviceTypeManager implements DeviceManager { } else { String msg = "Could not save DeviceTypePluginDAOManager since device type is null or empty."; log.error(msg); - throw new DeviceTypePluginExtensionException(msg); + throw new DeviceTypeDeployerPayloadException(msg); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java index bfe01098b61..e32c9e2d573 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypePluginExtensionServiceImpl.java @@ -34,21 +34,26 @@ public class DeviceTypePluginExtensionServiceImpl implements DeviceTypePluginExt private static volatile Map pluginDAOManagers = new HashMap<>(); @Override - public void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager) { + public void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager) + throws DeviceTypePluginExtensionException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - if (pluginDAOManager != null) { - if (!pluginDAOManagers.containsKey(tenantId + deviceType)) { - if (log.isDebugEnabled()) { - log.debug("Saving DeviceTypePluginDAOManager against tenant id " + tenantId + - " and device type: " + deviceType); - } - pluginDAOManagers.put(tenantId + deviceType, pluginDAOManager); + if (pluginDAOManager == null) { + String msg = "Cannot save DeviceTypePluginDAOManager against tenant id " + tenantId + + " and device type: " + deviceType + " since DeviceTypePluginDAOManager is null"; + log.error(msg); + throw new DeviceTypePluginExtensionException(msg); + } + if (!pluginDAOManagers.containsKey(tenantId + deviceType)) { + if (log.isDebugEnabled()) { + log.debug("Saving DeviceTypePluginDAOManager against tenant id " + tenantId + + " and device type: " + deviceType); } + pluginDAOManagers.put(tenantId + deviceType, pluginDAOManager); } } @Override - public DeviceTypePluginDAOManager getPluginDAOManager(String deviceType) { + public DeviceTypePluginDAOManager getPluginDAOManager(String deviceType) throws DeviceTypePluginExtensionException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); if (pluginDAOManagers.containsKey(tenantId + deviceType)) { if (log.isDebugEnabled()) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java index edbbba52c67..417d0788688 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/dao/DeviceTypeDAOHandler.java @@ -49,7 +49,9 @@ public class DeviceTypeDAOHandler { Context ctx = new InitialContext(); dataSource = (DataSource) ctx.lookup(datasourceName); } catch (NamingException e) { - throw new DeviceTypeDeployerPayloadException("Error while looking up the data source: " + datasourceName, e); + String msg = "Error while looking up the data source: " + datasourceName; + log.error(msg, e); + throw new DeviceTypeDeployerPayloadException(msg, e); } } @@ -57,12 +59,16 @@ public class DeviceTypeDAOHandler { try { Connection conn = currentConnection.get(); if (conn != null) { - throw new IllegalTransactionStateException("Database connection has already been obtained."); + String msg = "Database connection has already been obtained."; + log.error(msg); + throw new IllegalTransactionStateException(msg); } conn = dataSource.getConnection(); currentConnection.set(conn); } catch (SQLException e) { - throw new DeviceTypeMgtPluginException("Failed to get a database connection.", e); + String msg = "Failed to get a database connection."; + log.error(msg, e); + throw new DeviceTypeMgtPluginException(msg, e); } } @@ -72,7 +78,9 @@ public class DeviceTypeDAOHandler { conn.setAutoCommit(false); currentConnection.set(conn); } catch (SQLException e) { - throw new DeviceTypeMgtPluginException("Error occurred while retrieving datasource connection", e); + String msg = "Error occurred while retrieving datasource connection"; + log.error(msg, e); + throw new DeviceTypeMgtPluginException(msg, e); } } @@ -81,7 +89,9 @@ public class DeviceTypeDAOHandler { try { currentConnection.set(dataSource.getConnection()); } catch (SQLException e) { - throw new DeviceTypeMgtPluginException("Error occurred while retrieving data source connection", e); + String msg = "Error occurred while retrieving data source connection"; + log.error(msg, e); + throw new DeviceTypeMgtPluginException(msg, e); } } return currentConnection.get(); @@ -90,25 +100,28 @@ public class DeviceTypeDAOHandler { public void commitTransaction() { Connection conn = currentConnection.get(); if (conn == null) { - throw new IllegalStateException("No connection is associated with the current transaction. " + - "This might have ideally been caused by not properly initiating the " + - "transaction via 'beginTransaction'/'openConnection' methods"); + String msg = "No connection is associated with the current transaction. This might have ideally been " + + "caused by not properly initiating the transaction via " + + "'beginTransaction'/'openConnection' methods"; + log.error(msg); + throw new IllegalStateException(msg); } try { conn.commit(); } catch (SQLException e) { - log.error("Error occurred while committing the transaction.", e); + String msg = "Error occurred while committing the transaction."; + log.error(msg, e); } } public void closeConnection() { - Connection con = currentConnection.get(); if (con != null) { try { con.close(); } catch (SQLException e) { - log.error("Error occurred while close the connection"); + String msg = "Error occurred while close the connection"; + log.error(msg, e); } } currentConnection.remove(); @@ -117,14 +130,17 @@ public class DeviceTypeDAOHandler { public void rollbackTransaction() { Connection conn = currentConnection.get(); if (conn == null) { - throw new IllegalStateException("No connection is associated with the current transaction. " + - "This might have ideally been caused by not properly initiating the " + - "transaction via 'beginTransaction'/'openConnection' methods"); + String msg = "No connection is associated with the current transaction. This might have ideally been " + + "caused by not properly initiating the transaction via " + + "'beginTransaction'/'openConnection' methods"; + log.error(msg); + throw new IllegalStateException(msg); } try { conn.rollback(); } catch (SQLException e) { - log.error("Error occurred while roll-backing the transaction.", e); + String msg = "Error occurred while roll-backing the transaction."; + log.error(msg, e); } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java index 7afbd12cd2b..b0603f43bfb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/exception/DeviceTypePluginExtensionException.java @@ -1,6 +1,6 @@ package org.wso2.carbon.device.mgt.extensions.device.type.template.exception; -public class DeviceTypePluginExtensionException extends RuntimeException { +public class DeviceTypePluginExtensionException extends Exception { public DeviceTypePluginExtensionException(String msg) { super(msg); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java index 26aaf481e2d..f91ed2e985c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/spi/DeviceTypePluginExtensionService.java @@ -18,6 +18,7 @@ package org.wso2.carbon.device.mgt.extensions.spi; import org.wso2.carbon.device.mgt.extensions.device.type.template.dao.DeviceTypePluginDAOManager; +import org.wso2.carbon.device.mgt.extensions.device.type.template.exception.DeviceTypePluginExtensionException; /** * This represents the device type plugin extension service which can be used by any device type plugin implementation @@ -29,13 +30,16 @@ public interface DeviceTypePluginExtensionService { * Save device type specific DeviceTypePluginDAOManager in a HashMap againast tenant ID and device type * @param deviceType - Type of the device (i.e; android, ios, windows) * @param pluginDAOManager - Device type plugin DAO manager instance to be saved against device type + * @throws DeviceTypePluginExtensionException when pluginDAOManager is null */ - void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager); + void addPluginDAOManager(String deviceType, DeviceTypePluginDAOManager pluginDAOManager) + throws DeviceTypePluginExtensionException; /** * Retrieve the DeviceTypePluginDAOManager instance against tenant ID and given device type * @param deviceType - Type of the device (i.e; android, ios, windows) * @return an Instance of {@link DeviceTypePluginDAOManager} + * @throws DeviceTypePluginExtensionException when pluginDAOManager cannot be found */ - DeviceTypePluginDAOManager getPluginDAOManager(String deviceType); + DeviceTypePluginDAOManager getPluginDAOManager(String deviceType) throws DeviceTypePluginExtensionException; }