diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index 9b4bb2043c..e66e38d556 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index 835ed077f3..5e7794b952 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index de06da15aa..c84dea655a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index 082a4817ff..21338e0129 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index 875390e1f7..40eb78b086 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index d6dd156a35..d55e743327 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -17,14 +17,12 @@ ~ under the License. --> - + certificate-mgt org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml @@ -76,8 +74,7 @@ - + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml index b38133cc1f..df2b2cf629 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml @@ -32,7 +32,7 @@ get certificate in the database - /device-mgt/emm-admin/certificate/GetSignCSR + /device-mgt/admin/certificate/GetSignCSR /certificates/scep/signcsr POST emm_admin diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index ba723c77f8..ef7e43ce4b 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -17,14 +17,12 @@ ~ under the License. --> - + certificate-mgt org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml @@ -72,8 +70,7 @@ - + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/permissions.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/permissions.xml index dcd6b92155..0fc4702145 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/permissions.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/permissions.xml @@ -32,22 +32,16 @@ - Save certificate - /device-mgt/admin/certificate/Save + View all certificates + /device-mgt/admin/certificate/GetAll /admin/certificates - POST - - - Get certificate - /device-mgt/admin/certificate/Get - /admin/certificates/* GET - Get all certificates - /device-mgt/admin/certificate/GetAll + Add certificate + /device-mgt/admin/certificate/Add /admin/certificates - GET + POST Remove certificate @@ -55,5 +49,11 @@ /admin/certificates/* DELETE + + View certificate + /device-mgt/admin/certificate/View + /admin/certificates/* + GET + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index 0cd8544824..2f9145d6a7 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt certificate-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java index 3c3278f89f..9d1129d067 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java @@ -67,10 +67,9 @@ public class GenericCertificateDAOImpl implements CertificateDAO { serialNumber = String.valueOf(certificate.getCertificate().getSerialNumber()); } byte[] bytes = Serializer.serialize(certificate.getCertificate()); - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); stmt.setString(1, serialNumber); - stmt.setObject(2, byteArrayInputStream); + stmt.setBytes(2, bytes); stmt.setInt(3, certificate.getTenantId()); stmt.setString(4, username); stmt.addBatch(); @@ -102,7 +101,7 @@ public class GenericCertificateDAOImpl implements CertificateDAO { stmt.setInt(2, tenantId); resultSet = stmt.executeQuery(); - while (resultSet.next()) { + if (resultSet.next()) { certificateResponse = new CertificateResponse(); byte [] certificateBytes = resultSet.getBytes("CERTIFICATE"); certificateResponse.setCertificate(certificateBytes); @@ -110,7 +109,6 @@ public class GenericCertificateDAOImpl implements CertificateDAO { certificateResponse.setTenantId(resultSet.getInt("TENANT_ID")); certificateResponse.setUsername(resultSet.getString("USERNAME")); CertificateGenerator.extractCertificateDetails(certificateBytes, certificateResponse); - break; } } catch (SQLException e) { String errorMsg = diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index 94b57794e1..ce2a907670 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml index e83f180ef3..92cd0b671f 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index e66aea25ab..057f67d624 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index f0a2cc79c5..b46e0eb81a 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index dedf78615a..76c230ac23 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml index 4d93cbc66d..50ca053094 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt device-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index 80cc16d18c..dde3a03019 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 36deba6c9b..e6399a2500 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java index 9ae3ade67e..e423f56708 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/BasePaginatedResult.java @@ -28,7 +28,7 @@ public class BasePaginatedResult { private String previous; /** - * Number of Devices returned. + * Number of Resources returned. */ @ApiModelProperty(value = "Number of resources returned.") @JsonProperty("count") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceCompliance.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceCompliance.java new file mode 100644 index 0000000000..6f74422514 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceCompliance.java @@ -0,0 +1,55 @@ +/* + * 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. + * + */ +package org.wso2.carbon.device.mgt.jaxrs.beans; + +import io.swagger.annotations.ApiModel; +import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData; + +@ApiModel(value = "DeviceCompliance", description = "Device's policy compliance status") +public class DeviceCompliance { + + private String deviceID; + private ComplianceData complianceData; + private Long code; + + public ComplianceData getComplianceData() { + return complianceData; + } + + public void setComplianceData(ComplianceData complianceData) { + this.complianceData = complianceData; + } + + public Long getCode() { + return code; + } + + public void setCode(Long code) { + this.code = code; + } + + public String getDeviceID() { + return deviceID; + } + + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + } + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeList.java new file mode 100644 index 0000000000..0398b6c7cf --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeList.java @@ -0,0 +1,101 @@ +/* + * 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. + * + */ +package org.wso2.carbon.device.mgt.jaxrs.beans; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import org.wso2.carbon.device.mgt.common.Device; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceTypeList { + + private int count; + private String next; + private String previous; + private List deviceTypes = new ArrayList<>(); + + /** + * Number of Devices Types returned. + */ + @ApiModelProperty(value = "Number of resources returned.") + @JsonProperty("count") + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + + /** + * Link to the next subset of resources qualified. \nEmpty if no more resources are to be returned. + */ + @ApiModelProperty(value = "Link to the next subset of resources qualified. \n " + + "Empty if no more resources are to be returned.") + @JsonProperty("next") + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + /** + * Link to the previous subset of resources qualified. \nEmpty if current subset is the first subset returned. + */ + @ApiModelProperty(value = "Link to the previous subset of resources qualified. \n" + + "Empty if current subset is the first subset returned.") + @JsonProperty("previous") + public String getPrevious() { + return previous; + } + + public void setPrevious(String previous) { + this.previous = previous; + } + + @ApiModelProperty(value = "List of device types returned") + @JsonProperty("devicesTypes") + public List getList() { + return deviceTypes; + } + + public void setList(List deviceTypes) { + this.deviceTypes = deviceTypes; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{\n"); + + sb.append(" count: ").append(getCount()).append(",\n"); + sb.append(" next: ").append(getNext()).append(",\n"); + sb.append(" previous: ").append(getPrevious()).append(",\n"); + sb.append(" deviceTypes: [").append(deviceTypes).append("\n"); + sb.append("]}\n"); + return sb.toString(); + } + + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java index 17f8b905bf..27aebb2abf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/Profile.java @@ -40,7 +40,7 @@ public class Profile { private int tenantId; @ApiModelProperty(name = "deviceType", value = "Contains the device type details the policy was created " + "for", required = true) - private DeviceType deviceType; + private String deviceType; @ApiModelProperty(name = "createdDate", value = "The date the policy was created", required = true) private Timestamp createdDate; @ApiModelProperty(name = "updatedDate", value = "The date the changes made to the policy was published to" @@ -50,11 +50,11 @@ public class Profile { + "in the policy", required = true) private List profileFeaturesList; // Features included in the policies. - public DeviceType getDeviceType() { + public String getDeviceType() { return deviceType; } - public void setDeviceType(DeviceType deviceType) { + public void setDeviceType(String deviceType) { this.deviceType = deviceType; } @XmlElement diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java index 81d8032799..7a214c308c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ProfileFeature.java @@ -37,7 +37,7 @@ public class ProfileFeature implements Serializable { private int profileId; @ApiModelProperty(name = "deviceTypeId", value = "The ID used to define the type of the device platform", required = true) - private int deviceTypeId; + private String deviceType; @ApiModelProperty(name = "content", value = "The list of parameters that define the policy", required = true) private Object content; @@ -69,12 +69,12 @@ public class ProfileFeature implements Serializable { this.profileId = profileId; } - public int getDeviceTypeId() { - return deviceTypeId; + public String getDeviceTypeId() { + return deviceType; } - public void setDeviceTypeId(int deviceTypeId) { - this.deviceTypeId = deviceTypeId; + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; } 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 d2ef6fc701..0b0543e9d8 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 @@ -29,6 +29,7 @@ import org.wso2.carbon.device.mgt.common.search.SearchContext; import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceList; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.policy.mgt.common.Policy; +import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @@ -92,6 +93,11 @@ public interface DeviceManagementService { }) @Permission(scope = "device:list", roles = {"admin"}) Response getDevices( + @ApiParam( + name = "name", + value = "The device name, such as shamu, bullhead or angler.", + required = false) + String name, @ApiParam( name = "type", value = "The device type, such as ios, android or windows.", @@ -639,4 +645,45 @@ public interface DeviceManagementService { @HeaderParam("If-Modified-Since") String ifModifiedSince); + + + @GET + @Path("{type}/{id}/compliance-data") + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Get the effective policy calculated for a device.", + notes = "When a device registers with WSO2 EMM a policy is enforced on the device. Initially the " + + "EMM filters the policies based on the Platform (device type), filters based on the " + + "device ownership type , filters based on the user role or name and finally the policy" + + " is enforced on the device.", + tags = "Device Management") + @ApiResponses( + value = { + @ApiResponse( + code = 200, + message = "OK", + response = ComplianceData.class), + @ApiResponse( + code = 400, + message = "Bad Request. \n Invalid request or validation error.", + response = ErrorResponse.class), + @ApiResponse( + code = 500, + message = "Error occurred while getting the compliance data.", + response = ErrorResponse.class) + } + ) + Response getComplianceDataOfDevice( + @ApiParam( + name = "type", + value = "The device type, such as ios, android or windows.", + required = true) + @PathParam("type") + String type, + @ApiParam( + name = "id", + value = "Device Identifier", + required = true) + @PathParam("id") String id); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java index 9ba7895093..7767a9f0a7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java @@ -119,7 +119,7 @@ public interface NotificationManagementService { int limit); @PUT - @Path("{id}/mark-checked") + @Path("/{id}/mark-checked") @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "PUT", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index 0886dde7dd..4825f1a405 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -26,6 +26,7 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.*; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.util.List; @API(name = "User Management", version = "1.0.0", context = "/api-device-mgt-v1.0/users", tags = {"devicemgt_admin"}) @@ -451,4 +452,42 @@ public interface UserManagementService { value = "Credential.", required = true) OldPasswordResetWrapper credentials); + @POST + @Path("/send-invitation") + @ApiOperation( + consumes = MediaType.APPLICATION_JSON, + produces = MediaType.APPLICATION_JSON, + httpMethod = "POST", + value = "Send invitation mail.", + notes = "A user is able to send invitation mail via this REST API.", + tags = "User Management") + @ApiResponses(value = { + @ApiResponse( + code = 200, + message = "OK. \n Invitation mails have been sent."), + @ApiResponse( + code = 400, + message = "Bad Request. \n Invalid request or validation error.", + response = ErrorResponse.class), + @ApiResponse( + code = 404, + message = "Not Found. \n Resource to be deleted does not exist.", + response = ErrorResponse.class), + @ApiResponse( + code = 415, + message = "Unsupported media type. \n The entity of the request was in a not supported format.", + response = ErrorResponse.class), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n " + + "Server error occurred while updating credentials of the user.", + response = ErrorResponse.class) + }) + @Permission(scope = "user:invite", roles = {"admin"}) + Response inviteExistingUsersToEnrollDevice( + @ApiParam( + name = "users", + value = "List of users", + required = true) List usernames); + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementService.java new file mode 100644 index 0000000000..2447e2c97c --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementService.java @@ -0,0 +1,90 @@ +/* + * 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. + * + */ +package org.wso2.carbon.device.mgt.jaxrs.service.api.admin; + +import io.swagger.annotations.*; +import org.wso2.carbon.apimgt.annotations.api.API; +import org.wso2.carbon.apimgt.annotations.api.Permission; +import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceTypeList; +import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; + +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@API(name = "Device Type Management", version = "1.0.0", context = "/admin/device-types", tags = {"devicemgt_admin"}) + +@Path("/admin/device-types") +@Api(value = "Device Type Management", description = "This API corresponds to all tasks related to device " + + "type management") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public interface DeviceTypeManagementService { + + @GET + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Get the list of device types registered.", + notes = "Retrieves the list of device types of which the devices intended to be managed.", + tags = "Device Type Management") + @ApiResponses( + value = { + @ApiResponse( + code = 200, + message = "OK. \n Successfully fetched the list of supported device types.", + response = DeviceTypeList.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. \n Empty body because the client has already the latest version of " + + "the requested resource."), + @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) + } + ) + @Permission(scope = "device-types:read", roles = {"admin"}) + Response getDeviceTypes( + @ApiParam( + name = "If-Modified-Since", + value = "Validates if the requested variant has not been modified since the time specified", + required = false) + @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/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 edac09a140..2266f51d4a 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 @@ -20,6 +20,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.context.CarbonContext; import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; @@ -30,6 +31,7 @@ import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderServ import org.wso2.carbon.device.mgt.core.search.mgt.SearchManagerService; import org.wso2.carbon.device.mgt.core.search.mgt.SearchMgtException; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; +import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceCompliance; import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceList; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.OperationList; @@ -38,6 +40,8 @@ import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil; import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.policy.mgt.common.Policy; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; +import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData; +import org.wso2.carbon.policy.mgt.common.monitor.PolicyComplianceException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; import javax.ws.rs.*; @@ -58,6 +62,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @GET @Override public Response getDevices( + @QueryParam("name") String name, @QueryParam("type") String type, @QueryParam("user") String user, @QueryParam("roleName") String roleName, @@ -68,29 +73,32 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @QueryParam("offset") int offset, @QueryParam("limit") int limit) { try { - RequestValidationUtil.validateSelectionCriteria(type, user, roleName, ownership, status); +// RequestValidationUtil.validateSelectionCriteria(type, user, roleName, ownership, status); DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); PaginationRequest request = new PaginationRequest(offset, limit); PaginationResult result; DeviceList devices = new DeviceList(); - if (type != null) { + if(name != null && !name.isEmpty()){ + request.setDeviceName(name); + } + if (type != null && !type.isEmpty()) { request.setDeviceType(type); } - if (user != null) { + if (user != null && !user.isEmpty()) { request.setOwner(user); } - if (ownership != null) { + if (ownership != null && !ownership.isEmpty()) { RequestValidationUtil.validateOwnershipType(ownership); request.setOwnership(ownership); } - if (status != null) { + if (status != null && !status.isEmpty()) { RequestValidationUtil.validateStatus(status); request.setStatus(status); } - if (ifModifiedSince != null) { + if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) { Date sinceDate; SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z"); try { @@ -106,7 +114,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { return Response.status(Response.Status.NOT_MODIFIED).entity("No device is modified " + "after the timestamp provided in 'If-Modified-Since' header").build(); } - } else if (since != null) { + } else if (since != null && !since.isEmpty()) { Date sinceDate; SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z"); try { @@ -141,6 +149,32 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { } } + @GET + @Path("/user-devices") + public Response getDeviceByUser(@QueryParam("offset") int offset, + @QueryParam("limit") int limit) { + + PaginationRequest request = new PaginationRequest(offset, limit); + PaginationResult result; + DeviceList devices = new DeviceList(); + + String currentUser = CarbonContext.getThreadLocalCarbonContext().getUsername(); + request.setOwner(currentUser); + + try { + result = DeviceMgtAPIUtils.getDeviceManagementService().getDevicesOfUser(request); + devices.setList((List) result.getData()); + devices.setCount(result.getRecordsTotal()); + return Response.status(Response.Status.OK).entity(devices).build(); + } catch (DeviceManagementException e) { + String msg = "Error occurred while fetching all enrolled devices"; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + } + + @GET @Path("/{type}/{id}") @Override @@ -301,4 +335,48 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { } } + @GET + @Path("{type}/{id}/compliance-data") + public Response getComplianceDataOfDevice(@PathParam("type") String type, + @PathParam("id") String id) { + + RequestValidationUtil.validateDeviceIdentifier(type, id); + PolicyManagerService policyManagementService = DeviceMgtAPIUtils.getPolicyManagementService(); + Policy policy; + ComplianceData complianceData = null; + DeviceCompliance deviceCompliance = new DeviceCompliance(); + + try { + policy = policyManagementService.getAppliedPolicyToDevice(new DeviceIdentifier(id, type)); + } catch (PolicyManagementException e) { + String msg = "Error occurred while retrieving the current policy associated with the '" + type + + "' device, which carries the id '" + id + "'"; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + + if (policy == null) { + deviceCompliance.setDeviceID(id); + deviceCompliance.setComplianceData(null); + //deviceCompliance.setCode(0001l); //code 0001 means no compliance data related to the device + return Response.status(Response.Status.OK).entity(deviceCompliance).build(); + } else { + try { + policyManagementService = DeviceMgtAPIUtils.getPolicyManagementService(); + complianceData = policyManagementService.getDeviceCompliance( + new DeviceIdentifier(id, type)); + deviceCompliance.setDeviceID(id); + deviceCompliance.setComplianceData(complianceData); + //deviceCompliance.setCode(0002l); //code 0002 means there are compliance data related to the device + return Response.status(Response.Status.OK).entity(deviceCompliance).build(); + } catch (PolicyComplianceException e) { + String error = "Error occurred while getting the compliance data."; + log.error(error, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(error).build()).build(); + } + } + } + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImpl.java index ec01db35cd..c504da33d1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/NotificationManagementServiceImpl.java @@ -76,7 +76,7 @@ public class NotificationManagementServiceImpl implements NotificationManagement } @PUT - @Path("{id}/mark-checked") + @Path("/{id}/mark-checked") public Response updateNotificationStatus( @PathParam("id") int id) { String msg; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java index 41524f8862..0e8d90ffc0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java @@ -21,6 +21,9 @@ package org.wso2.carbon.device.mgt.jaxrs.service.impl; import org.apache.commons.lang.StringUtils; 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.core.service.DeviceManagementProviderService; +import org.wso2.carbon.device.mgt.core.service.EmailMetaInfo; import org.wso2.carbon.device.mgt.jaxrs.beans.*; import org.wso2.carbon.device.mgt.jaxrs.service.api.UserManagementService; import org.wso2.carbon.device.mgt.jaxrs.util.Constants; @@ -338,6 +341,43 @@ public class UserManagementServiceImpl implements UserManagementService { return CredentialManagementResponseBuilder.buildChangePasswordResponse(username, credentials); } + /** + * Method used to send an invitation email to a existing user to enroll a device. + * + * @param usernames Username list of the users to be invited + */ + @POST + @Path("send-invitation") + @Produces({MediaType.APPLICATION_JSON}) + public Response inviteExistingUsersToEnrollDevice(List usernames) { + if (log.isDebugEnabled()) { + log.debug("Sending enrollment invitation mail to existing user."); + } + DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); + try { + for (String username : usernames) { + String recipient = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS); + + Properties props = new Properties(); + props.setProperty("first-name", getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME)); + props.setProperty("username", username); + + EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props); + dms.sendEnrolmentInvitation(metaInfo); + } + } catch (DeviceManagementException e) { + String msg = "Error occurred while inviting user to enrol their device"; + log.error(msg, e); + } catch (UserStoreException e) { + String msg = "Error occurred while getting claim values to invite user"; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + return Response.status(Response.Status.OK).entity("Invitation mails have been sent.").build(); + } + + private Map buildDefaultUserClaims(String firstName, String lastName, String emailAddress) { Map defaultUserClaims = new HashMap<>(); defaultUserClaims.put(Constants.USER_CLAIM_FIRST_NAME, firstName); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementServiceImpl.java new file mode 100644 index 0000000000..fdda3bdd88 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementServiceImpl.java @@ -0,0 +1,59 @@ +/* + * 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. + * + */ +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.jaxrs.beans.DeviceTypeList; +import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; +import org.wso2.carbon.device.mgt.jaxrs.service.api.admin.DeviceTypeManagementService; +import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; + +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.Path; +import javax.ws.rs.core.Response; +import java.util.List; + +@Path("/admin/device-types") +public class DeviceTypeManagementServiceImpl implements DeviceTypeManagementService { + + private static Log log = LogFactory.getLog(DeviceTypeManagementServiceImpl.class); + + @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(); + } + } + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtUtil.java index c2f5c2b701..98461d153a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtUtil.java @@ -52,7 +52,7 @@ public class DeviceMgtUtil { new org.wso2.carbon.policy.mgt.common.ProfileFeature(); profileFeature.setProfileId(mdmProfileFeature.getProfileId()); profileFeature.setContent(mdmProfileFeature.getPayLoad()); - profileFeature.setDeviceTypeId(mdmProfileFeature.getDeviceTypeId()); + profileFeature.setDeviceType(mdmProfileFeature.getDeviceTypeId()); profileFeature.setFeatureCode(mdmProfileFeature.getFeatureCode()); profileFeature.setId(mdmProfileFeature.getId()); return profileFeature; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml index a92a3c184b..adb813272d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml @@ -29,956 +29,374 @@ --> - - - Device Management - /device-mgt - / - GET - - - - Device Management Admin - /device-mgt/admin - / - GET - - - - Device Management User - /device-mgt/user - / - GET - - - - Devices - /device-mgt/admin/devices - / - GET - - - - User Devices - /device-mgt/user/devices - / - GET - - - - Policies - /device-mgt/admin/policies - / - GET - - - - User Policies - /device-mgt/user/policies - / - GET - - - - Notifications - /device-mgt/admin/notifications - / - GET - - - - User Notifications - /device-mgt/user/notifications - / - GET - - - - Users - /device-mgt/admin/users - / - GET - - - - Operations - /device-mgt/admin/operations - / - GET - - - - User Operations - /device-mgt/user/operations - / - GET - - - - Applications - /device-mgt/admin/operations/applications - / - GET - - - - Roles - /device-mgt/admin/roles - / - GET - - - - Configurations - /device-mgt/admin/platform-configs - / - GET - - - - View Dashboard - /device-mgt/admin/dashboard - / - GET - + + Device Management + /device-mgt + / + GET + + + + Device Management Admin + /device-mgt/admin + / + GET + + + Devices + /device-mgt/admin/devices + / + GET + + + + List devices + /device-mgt/admin/devices/List + /devices + GET + + + Search devices + /device-mgt/admin/devices/Search + /devices/search-devices + POST + + + View device + /device-mgt/admin/devices/View + /devices/*/* + GET + + + View device applications + /device-mgt/admin/devices/View-Applications + /devices/*/*/applications + GET + + + View device effective-policy + /device-mgt/admin/devices/View-Active-Policy + /devices/*/*/effective-policy + GET + + + View devices feature + /device-mgt/admin/devices/View-Features + /devices/*/*/features + GET + + + View device operations + /device-mgt/admin/devices/View-Operations + /devices/*/*/operations + GET + + + View Compliance Data + /device-mgt/admin/devices/View-Compliance-Data + /devices/*/*/compliance-data + GET + + + List all devices + /device-mgt/admin/devices/Admin-View + /admin/devices + GET + + + + Policies + /device-mgt/admin/policies + / + GET + + + + List policies + /device-mgt/admin/policies/List + /policies + GET + + + Add Policy + /device-mgt/admin/policies/Add + /policies + POST + + + Activate policy + /device-mgt/admin/policies/Activate-Policy + /policies/activate-policy + PUT + + + Deactivate Policy + /device-mgt/admin/policies/Deactivate-Policy + /policies/deactivate-policy + PUT + + + Remove Policy + /device-mgt/admin/policies/Remove + /policies/remove-policy + POST + + + View Policy + /device-mgt/admin/policies/View + /policies/* + GET + + + Update Policy + /device-mgt/admin/policies/Update + /policies/* + PUT + + + Update Policy + /device-mgt/admin/policies/Update + /policies/apply-changes + PUT + + + Update Policy + /device-mgt/admin/policies/Change-Priority + /policies/priorities + PUT + + + + Notifications + /device-mgt/admin/notifications + / + GET + + + + View notifications + /device-mgt/admin/notifications/View + /notifications + GET + + + Mark checked notifications + /device-mgt/admin/notifications/View + /notifications/*/mark-checked + PUT + + + + Users + /device-mgt/admin/users + / + GET + + + + List users + /device-mgt/admin/users/List + /users + GET + + + Add user + /device-mgt/admin/users/Add + /users + POST + + + List users + /device-mgt/admin/users/Search + /users/search/usernames + GET + + + Remove user + /device-mgt/admin/users/Remove + /users/* + DELETE + + + View user + /device-mgt/admin/users/View + /users/* + GET + + + Update user + /device-mgt/admin/users/Update + /users/* + PUT + + + Update user credentials + /device-mgt/admin/users/Change-Password + /users/*/credentials + PUT + + + View assigned role + /device-mgt/admin/roles/Assigned-Roles + /users/*/roles + GET + + + Change any user credentials + /device-mgt/admin/users/Change-Password-Any + /admin/users/*/credentials + POST + + + Send invitation mail + /device-mgt/admin/users/Send-invitations + /users/send-invitation + POST + + + + Roles + /device-mgt/admin/roles + / + GET + + + + List roles + /device-mgt/admin/roles/List + /roles + GET + + + Add role + /device-mgt/admin/roles/Add + /roles + POST + + + Remove role + /device-mgt/admin/roles/Remove + /roles/* + DELETE + + + View role + /device-mgt/admin/roles/View + /roles/* + GET + + + Update role + /device-mgt/admin/roles/Update + /roles/* + PUT + + + View role permissions + /device-mgt/admin/roles/View-Permission + /roles/*/permissions + GET + + + Add Users to role + /device-mgt/admin/roles/Add-Users + /roles/*/users + PUT + + + + Configurations + /device-mgt/admin/general-configs + / + GET + + + + View configuration + /device-mgt/admin/general-configuration/View + /configuration + GET + + + Update configuration + /device-mgt/admin/general-configuration/Update + /configuration + PUT + + + + Activities + /device-mgt/admin/activities + / + GET + + + + View Activities + /device-mgt/admin/activities/View + /activities + GET + + + View Activity Details + /device-mgt/admin/activities/View + /activities/* + GET + + + + Applications + /device-mgt/admin/applications + / + GET + + + + Install Applications + /device-mgt/admin/application/Install + /admin/applications/install-application + POST + + + Uninstall-Applications + /device-mgt/admin/application/Uninstall + /admin/applications/uninstall-application + POST + + + + + + Device Management User + /device-mgt/user + / + GET + + + User Devices + /device-mgt/user/devices + / + GET + + + User Policies + /device-mgt/user/policies + / + GET + + + User Notifications + /device-mgt/user/notifications + / + GET + + + User Operations + /device-mgt/user/operations + / + GET + + - - - - Fetch Activity related details - /device-mgt/admin/activities/view - /activities/* - GET - - - Fetch Activity related details - /device-mgt/admin/activities/view - /activities - GET - - - - - List devices - /device-mgt/admin/devices/list - /devices - GET - - - List device types - /device-mgt/admin/devices/types - /devices/types - GET - - - Retrieve device information - /device-mgt/admin/devices/list - /devices/*/*/info - GET - - - Get device - /device-mgt/admin/devices/list - /devices/*/* - GET - - - Get device location - /device-mgt/admin/devices/list - /devices/*/*/location - GET - - - devices location - /device-mgt/admin/devices/list - /devices/locations - POST - - - Get devices feature - /device-mgt/admin/devices/list - /devices/*/*/features - GET - - - Search devices - /device-mgt/admin/devices/list - /devices/search-devices - POST - - - list device application - /device-mgt/admin/devices/list - /devices/*/*/applications - GET - - - list device operation - /device-mgt/admin/devices/list - /devices/*/*/operations - GET - - - list device effective-policy - /device-mgt/admin/devices/list - /devices/*/*/effective-policy - GET - - - list devices - /device-mgt/admin/devices/list - /admin/devices - GET - - - - - - - View notifications - /device-mgt/admin/notifications/view - /notifications - GET - - - - Add notification - /device-mgt/admin/notifications/add - /notifications - POST - - - - Update notification - /device-mgt/admin/notifications/update - /notifications/*/* - PUT - - - - View notifications - /device-mgt/admin/notifications/view - /notifications/* - GET - - - - - - View user - /device-mgt/admin/users/view - /operations - GET - - - - Install application - /device-mgt/admin/operations/applications/install-applications - /operations - POST - - - - Install application - /device-mgt/admin/operations/applications/install-applications - /operations/installApp/* - POST - - - - Uninstall application - /device-mgt/admin/operations/applications/uninstall-applications - /operations/uninstallApp/* - POST - - - - View application - /device-mgt/admin/operations/applications/view-applications - /operations/*/*/* - GET - - - - View devices - /device-mgt/user/devices/view - /operations/*/*/* - GET - - - - View device - /device-mgt/admin/devices/view - /operations/*/*/* - GET - - - - View device - /device-mgt/admin/devices/view - /operations/*/* - GET - - - - View device - /device-mgt/admin/devices/view - /operations/paginate/*/* - GET - - - - View device - /device-mgt/user/devices/view - /operations/*/* - GET - - - - View device - /device-mgt/user/devices/view - /operations/paginate/*/* - GET - - - - View device - /device-mgt/admin/devices/view - /devices/*/*/operations - GET - - - - View device - /device-mgt/user/devices/view - /devices/*/*/operations - GET - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - List policies - /device-mgt/admin/policies/list - /devices/*/*/features - GET - - - - View device - /device-mgt/admin/devices/view - /devices/*/*/features - GET - - - - View device - /device-mgt/user/devices/view - /devices/*/*/features - GET - - - - View device - /device-mgt/user/devices/view - /devices/*/*/features - GET - - - - - - - List roles - /device-mgt/admin/roles/list - /roles - GET - - - - View user - /device-mgt/admin/users/view - /roles - GET - - - - Add policy - /device-mgt/admin/policies/add - /roles - GET - - - - Update policy - /device-mgt/admin/policies/update - /roles - GET - - - - List roles - /device-mgt/admin/roles/list - /roles/*/permissions - GET - - - - List roles - /device-mgt/admin/roles/list - /roles/* - GET - - - - Add user - /device-mgt/admin/users/add - /roles/* - GET - - - - Update role - /device-mgt/admin/roles/update - /roles/* - PUT - - - - Update role - /device-mgt/admin/roles/update - /roles/*/users - PUT - - - - Add role - /device-mgt/admin/roles/add - /roles - POST - - - - Remove role - /device-mgt/admin/roles/remove - /roles/* - DELETE - - - - List roles - /device-mgt/admin/roles/list - /roles/count - GET - - - - - - List users - /device-mgt/admin/users/list - /users - GET - - - List users - /device-mgt/admin/users/list - /users/search/usernames - GET - - - Add user - /device-mgt/admin/users/add - /users - POST - - - Remove user - /device-mgt/admin/users/remove - /users/* - DELETE - - - View user - /device-mgt/admin/users/view - /users/* - GET - - - Update user - /device-mgt/admin/users/update - /users/* - PUT - - - Update user credential - /device-mgt/admin/users/update - /users/*/credentials - PUT - - - Get role - /device-mgt/admin/roles/add - /users/*/roles - GET - - - Update user credential - /device-mgt/admin/users/update - /admin/users/*/credentials - POST - - - - - - - - List policies - /device-mgt/admin/policies/list - /policies - GET - - - Add Policy - /device-mgt/admin/policies/add - /policies - POST - - - Activate policy - /device-mgt/admin/policies/add - /policies/activate-policy - PUT - - - Deactivate Policy - /device-mgt/admin/policies/add - /policies/deactivate-policy - PUT - - - Remove Policy - /device-mgt/admin/policies/remove - /policies/remove-policy - POST - - - View Policy - /device-mgt/admin/policies/view - /policies/* - GET - - - Update Policy - /device-mgt/admin/policies/update - /policies/* - Put - - - - - - Add policy - /device-mgt/admin/policies/add - /profiles - POST - - - - Edit policy - /device-mgt/admin/policies/update - /profiles/* - PUT - - - - Remove policy - /device-mgt/admin/policies/remove - /profiles/* - DELETE - - - - - - - Device Information - /device-mgt/admin/information/get - /information/*/* - GET - - - - Get additional information of devices - /device-mgt/admin/information/list - /devices/get-info - POST - - - - Device Search - /device-mgt/admin/search - /search - POST - - - - Device Updated - /device-mgt/admin/search/after - /search/after/* - GET - - - - - - - - - - - - - - - - - - - - - - - - View configuration - /device-mgt/admin/platform-configs/view - /configuration - GET - - - Update configuration - /device-mgt/admin/platform-configs/modify - /configuration - PUT - - - - - - - Save certificate in the database - /device-mgt/admin/certificate/save - /certificates - POST - - - get certificate in the database - /device-mgt/admin/certificate/Get - /certificates/* - GET - - - get certificate in the database - /device-mgt/admin/certificate/GetAll - /certificates - GET - - - get certificate in the database - /device-mgt/admin/certificate/Get - /certificates/* - DELETE - - - - - - Group Management Admin - /device-mgt/admin/groups - / - GET - - - - Group Management User - /device-mgt/user/groups - / - GET - - - - Add Group - /device-mgt/user/groups/add - /groups - POST - - - - Group update - /device-mgt/user/groups/update - /groups/owner/*/name/* - PUT - - - - Group Delete - /device-mgt/user/groups/remove - /groups/owner/*/name/* - DELETE - - - - List All Groups with Pagination - /device-mgt/admin/groups/list - /groups - GET - - - - List All Groups - /device-mgt/admin/groups/list - /groups/all - GET - - - - List Groups - /device-mgt/user/groups/list - /groups/user/* - GET - - - - List Groups - /device-mgt/user/groups/list - /groups/user/*/all - GET - - - - View Group - /device-mgt/user/groups/view - /groups/owner/*/name/* - GET - - - - Search Group User - /device-mgt/user/groups/list - /groups/user/*/search - GET - - - - All Group Count - /device-mgt/admin/groups/list - /groups/count - GET - - - - Group Count - /device-mgt/user/groups/list - /groups/user/*/count - GET - - - - Group Share - /device-mgt/user/groups/share - /groups/owner/*/name/*/share - PUT - - - - Group Unshare - /device-mgt/user/groups/unshare - /groups/owner/*/name/*/unshare - PUT - - - - Group Roles - /device-mgt/user/groups/roles - /groups/owner/*/name/*/share/roles - GET - - - - Group Roles - /device-mgt/user/groups/roles - /groups/owner/*/name/*/user/*/share/roles - PUT - - - - Group Permissions - /device-mgt/admin/groups/roles/permissions - /groups/owner/*/name/*/share/roles/*/permissions - GET - - - - Group Add Permissions - /device-mgt/admin/groups/roles/permissions/add - /groups/owner/*/name/*/share/roles/*/permissions - PUT - - - - Group Delete Permissions - /device-mgt/admin/groups/roles/permissions/remove - /groups/owner/*/name/*/share/roles/*/permissions - DELETE - - - - Group Users - /device-mgt/user/groups/users - / - GET - - - - List Group Users - /device-mgt/user/groups/users/list - /groups/owner/*/name/*/users - GET - - - - Get Permissions for Group - /device-mgt/user/groups/users/permissions - /groups/owner/*/name/*/users/*/permissions - GET - - - - Group Devices - /device-mgt/user/groups/devices - / - GET - - - - List Group Devices - /device-mgt/user/groups/devices/list - /groups/owner/*/name/*/devices - GET - - - - Group Devices Count - /device-mgt/user/groups/devices/count - /groups/owner/*/name/*/devices/count - GET - - - - Add Device to Group - /device-mgt/user/groups/devices/add - /groups/owner/*/name/*/devices - POST - - - - Remove Device from Group - /device-mgt/user/groups/devices/remove - /groups/owner/*/name/*/devices/*/* - DELETE - - - - - get device count overview - /device-mgt/admin/dashboard/device-count-overview - /dashboard/device-count-overview - GET - - - get device counts by potential vulnerabilities - /device-mgt/admin/dashboard/device-counts-by-potential-vulnerabilities - /dashboard/device-counts-by-potential-vulnerabilities - GET - - - get non-compliant device counts by features - /device-mgt/admin/dashboard/non-compliant-device-counts-by-features - /dashboard/non-compliant-device-counts-by-features - GET - - - get device counts by groups - /device-mgt/admin/dashboard/device-counts-by-groups - /dashboard/device-counts-by-groups - GET - - - get feature-non-compliant device counts by groups - /device-mgt/admin/dashboard/feature-non-compliant-device-counts-by-groups - /dashboard/feature-non-compliant-device-counts-by-groups - GET - - - get filtered device count over total - /device-mgt/admin/dashboard/filtered-device-count-over-total - /dashboard/filtered-device-count-over-total - GET - - - get feature-non-compliant device count over total - /device-mgt/admin/dashboard/feature-non-compliant-device-count-over-total - /dashboard/feature-non-compliant-device-count-over-total - GET - - - get devices with details - /device-mgt/admin/dashboard/devices-with-details - /dashboard/devices-with-details - GET - - - get feature-non-compliant devices with details - /device-mgt/admin/dashboard/feature-non-compliant-devices-with-details - /dashboard/feature-non-compliant-devices-with-details - GET - - 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 42eb1188dd..1b128fb450 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 @@ -38,6 +38,7 @@ + @@ -77,6 +78,7 @@ + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index 61b317b468..d8950c54e6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index be896513a2..e317b1d1b9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceTypeDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceTypeDAO.java index 53827abd6e..0e34fc1ab0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceTypeDAO.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceTypeDAO.java @@ -51,17 +51,17 @@ public interface DeviceTypeDAO { List getDeviceTypes(int tenantId) throws DeviceManagementDAOException; /** - * @param tenandId of the device type provider. + * @param tenantId of the device type provider. * @return return only the device types that are associated with the provider tenant. * @throws DeviceManagementDAOException */ - List getDeviceTypesByProvider(int tenandId) throws DeviceManagementDAOException; + List getDeviceTypesByProvider(int tenantId) throws DeviceManagementDAOException; /** * @return sharedWithAllDeviceTypes This returns public shared device types. * @throws DeviceManagementDAOException */ - List getSharedDeviceTypes() throws DeviceManagementDAOException; + List getSharedDeviceTypes() throws DeviceManagementDAOException; /** * @param id retrieve the device type with its id. diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java index 8ef838ef8e..c7e4952328 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java @@ -89,24 +89,21 @@ public class DeviceTypeDAOImpl implements DeviceTypeDAO { } @Override - public List getDeviceTypesByProvider(int tenantId) throws DeviceManagementDAOException { + public List getDeviceTypesByProvider(int tenantId) throws DeviceManagementDAOException { Connection conn; PreparedStatement stmt = null; ResultSet rs = null; - List deviceTypes = new ArrayList<>(); + List deviceTypes = new ArrayList<>(); try { conn = this.getConnection(); String sql = - "SELECT ID AS DEVICE_TYPE_ID, NAME AS DEVICE_TYPE FROM DM_DEVICE_TYPE where PROVIDER_TENANT_ID =?"; + "SELECT NAME AS DEVICE_TYPE FROM DM_DEVICE_TYPE where PROVIDER_TENANT_ID =?"; stmt = conn.prepareStatement(sql); stmt.setInt(1, tenantId); rs = stmt.executeQuery(); while (rs.next()) { - DeviceType deviceType = new DeviceType(); - deviceType.setId(rs.getInt("DEVICE_TYPE_ID")); - deviceType.setName(rs.getString("DEVICE_TYPE")); - deviceTypes.add(deviceType); + deviceTypes.add(rs.getString("DEVICE_TYPE")); } return deviceTypes; } catch (SQLException e) { @@ -117,25 +114,22 @@ public class DeviceTypeDAOImpl implements DeviceTypeDAO { } @Override - public List getSharedDeviceTypes() throws DeviceManagementDAOException { + public List getSharedDeviceTypes() throws DeviceManagementDAOException { Connection conn; PreparedStatement stmt = null; ResultSet rs = null; - List deviceTypes = new ArrayList<>(); + List deviceTypes = new ArrayList<>(); try { conn = this.getConnection(); String sql = - "SELECT ID AS DEVICE_TYPE_ID, NAME AS DEVICE_TYPE FROM DM_DEVICE_TYPE where " + + "SELECT NAME AS DEVICE_TYPE FROM DM_DEVICE_TYPE where " + "SHARED_WITH_ALL_TENANTS = ?"; stmt = conn.prepareStatement(sql); stmt.setBoolean(1, true); rs = stmt.executeQuery(); while (rs.next()) { - DeviceType deviceType = new DeviceType(); - deviceType.setId(rs.getInt("DEVICE_TYPE_ID")); - deviceType.setName(rs.getString("DEVICE_TYPE")); - deviceTypes.add(deviceType); + deviceTypes.add(rs.getString("DEVICE_TYPE")); } return deviceTypes; } catch (SQLException e) { 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 95e8716af1..d0211bcd94 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 @@ -207,7 +207,7 @@ public interface DeviceManagementProviderService { Device getDevice(DeviceIdentifier deviceId, EnrolmentInfo.Status status) throws DeviceManagementException; - List getAvailableDeviceTypes() throws DeviceManagementException; + List getAvailableDeviceTypes() throws DeviceManagementException; boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException; 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 536901f821..087f3eb50c 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 @@ -857,10 +857,10 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv } @Override - public List getAvailableDeviceTypes() throws DeviceManagementException { - List deviceTypesProvidedByTenant; - List publicSharedDeviceTypesInDB; - List deviceTypesResponse = new ArrayList<>(); + public List getAvailableDeviceTypes() throws DeviceManagementException { + List deviceTypesProvidedByTenant; + List publicSharedDeviceTypesInDB; + List deviceTypesResponse = new ArrayList<>(); try { DeviceManagementDAOFactory.openConnection(); int tenantId = this.getTenantId(); @@ -872,21 +872,20 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv if (registeredTypes != null) { if (deviceTypesProvidedByTenant != null) { - for (DeviceType deviceType : deviceTypesProvidedByTenant) { - DeviceTypeIdentifier providerKey = new DeviceTypeIdentifier(deviceType.getName(), tenantId); + for (String deviceType : deviceTypesProvidedByTenant) { + DeviceTypeIdentifier providerKey = new DeviceTypeIdentifier(deviceType, tenantId); if (registeredTypes.get(providerKey) != null) { deviceTypesResponse.add(deviceType); - deviceTypeSetForTenant.add(deviceType.getName()); + deviceTypeSetForTenant.add(deviceType); } } } // Get the device from the public space, however if there is another device with same name then give // priority to that if (publicSharedDeviceTypesInDB != null) { - for (DeviceType deviceType : publicSharedDeviceTypesInDB) { - DeviceTypeIdentifier providerKey = new DeviceTypeIdentifier(deviceType.getName()); - if (registeredTypes.get(providerKey) != null && !deviceTypeSetForTenant.contains( - deviceType.getName())) { + for (String deviceType : publicSharedDeviceTypesInDB) { + DeviceTypeIdentifier providerKey = new DeviceTypeIdentifier(deviceType); + if (registeredTypes.get(providerKey) != null && !deviceTypeSetForTenant.contains(deviceType)) { deviceTypesResponse.add(deviceType); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 9f4918442b..12315343eb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index 109acc5885..c877e80933 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 185aabc6d7..f21c127d9d 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml index 2293630331..238fadc87b 100644 --- a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml +++ b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt email-sender - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/email-sender/pom.xml b/components/email-sender/pom.xml index b5c6f41256..8919f7e723 100644 --- a/components/email-sender/pom.xml +++ b/components/email-sender/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml index 0348963989..20c88436e0 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml @@ -21,14 +21,14 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.mdm dynamic-client-web-proxy - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Proxy endpoint of Dynamic Client Registration Web Service WSO2 Carbon - Dynamic Client Registration Web Proxy war diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml index cb04fac4e1..d87b87183e 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml @@ -21,14 +21,14 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.mdm dynamic-client-web - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Dynamic Client Registration Web Service WSO2 Carbon - Dynamic Client Registration Web war diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml index fb7cf07a52..10d041d402 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml @@ -21,13 +21,13 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.registration - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Dynamic client registration service WSO2 Carbon - Dynamic Client Registration Service diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml index c05e521b81..f5ea0ab8c0 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml @@ -21,13 +21,13 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.web.app.registration - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Dynamic client web app registration WSO2 Carbon - Dynamic Client Web-app Registration Service diff --git a/components/identity-extensions/dynamic-client-registration/pom.xml b/components/identity-extensions/dynamic-client-registration/pom.xml index 7a8611708f..bf14dbc6f2 100644 --- a/components/identity-extensions/dynamic-client-registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt identity-extensions - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt dynamic-client-registration - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Dynamic client registration http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index 8023f94fd9..74f6d9bcf3 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt identity-extensions - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - OAuth Extensions http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index c5a6d6e0aa..e3a7c44ba4 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -21,7 +21,7 @@ identity-extensions org.wso2.carbon.devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT 4.0.0 diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml index f387524033..9336e2f7a4 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt identity-extensions - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml index e101d5cc16..e0092f1daf 100644 --- a/components/identity-extensions/pom.xml +++ b/components/identity-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml index 942524b9bb..32c743212e 100644 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.complex.policy.decision.point - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java index a4bc89bfe7..0cbcdb8dd2 100644 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java +++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java @@ -36,7 +36,7 @@ public class PolicyFilterImpl implements PolicyFilter { @Override public List extractPoliciesRelatedToRoles(List policyList, List roles) { - List policies = new ArrayList(); + List policies = new ArrayList<>(); for (Policy policy : policyList) { List roleList = policy.getRoles(); @@ -60,10 +60,10 @@ public class PolicyFilterImpl implements PolicyFilter { */ @Override public List extractPoliciesRelatedToDeviceType(List policyList, String deviceType) { - List policies = new ArrayList(); + List policies = new ArrayList<>(); for (Policy policy : policyList) { - if (policy.getProfile().getDeviceType().getName().equalsIgnoreCase(deviceType)) { + if (policy.getProfile().getDeviceType().equalsIgnoreCase(deviceType)) { policies.add(policy); } } diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml index 747704d760..042f01b66b 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt policy-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml @@ -11,7 +11,7 @@ 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.information.point - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Policy Information Point WSO2 Carbon - Policy Information Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml index 502b112c74..b6f290adf2 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Policy Management Common WSO2 Carbon - Policy Management Common diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/Profile.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/Profile.java index 259a1e19bc..0d3d08026d 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/Profile.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/Profile.java @@ -33,17 +33,17 @@ public class Profile implements Serializable { private int profileId; private String profileName; private int tenantId; - private DeviceType deviceType; + private String deviceType; private Timestamp createdDate; private Timestamp updatedDate; // private List featuresList; // Features included in the policies. private List profileFeaturesList; // Features included in the policies. - public DeviceType getDeviceType() { + public String getDeviceType() { return deviceType; } - public void setDeviceType(DeviceType deviceType) { + public void setDeviceType(String deviceType) { this.deviceType = deviceType; } @XmlElement diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/ProfileFeature.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/ProfileFeature.java index 5de755a35d..723f5fb49c 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/ProfileFeature.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/ProfileFeature.java @@ -38,7 +38,7 @@ public class ProfileFeature implements Serializable { private int profileId; @ApiModelProperty(name = "deviceTypeId", value = "The ID used to define the type of the device platform", required = true) - private int deviceTypeId; + private String deviceType; @ApiModelProperty(name = "content", value = "The list of parameters that define the policy", required = true) private Object content; @@ -67,12 +67,12 @@ public class ProfileFeature implements Serializable { this.profileId = profileId; } - public int getDeviceTypeId() { - return deviceTypeId; + public String getDeviceType() { + return deviceType; } - public void setDeviceTypeId(int deviceTypeId) { - this.deviceTypeId = deviceTypeId; + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; } public Object getContent() { diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml index 6a5147d772..3a56db2187 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Policy Management Core WSO2 Carbon - Policy Management Core diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyDAO.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyDAO.java index ce519e135f..db36c6ec99 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyDAO.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyDAO.java @@ -31,7 +31,7 @@ public interface PolicyDAO { Policy addPolicy(Policy policy) throws PolicyManagerDAOException; - Policy addPolicy(String deviceType, Policy policy) throws PolicyManagerDAOException; +// Policy addPolicyToDeviceType(String deviceType, Policy policy) throws PolicyManagerDAOException; /** * This method is used to add/update the roles associated with the policy. diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/ProfileDAO.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/ProfileDAO.java index 5d91650d7e..c5fe41a945 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/ProfileDAO.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/ProfileDAO.java @@ -85,6 +85,6 @@ public interface ProfileDAO { * @return retruns list of profiles. * @throws ProfileManagerDAOException */ - List getProfilesOfDeviceType(DeviceType deviceType) throws ProfileManagerDAOException; + List getProfilesOfDeviceType(String deviceType) throws ProfileManagerDAOException; } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/FeatureDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/FeatureDAOImpl.java index 196001c041..80e56af140 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/FeatureDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/FeatureDAOImpl.java @@ -66,14 +66,14 @@ public class FeatureDAOImpl implements FeatureDAO { try { conn = this.getConnection(); - String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE_ID, CONTENT, " + + String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT, " + "TENANT_ID) VALUES (?, ?, ?, ?, ?)"; stmt = conn.prepareStatement(query, new String[] {"id"}); for (ProfileFeature feature : features) { stmt.setInt(1, profileId); stmt.setString(2, feature.getFeatureCode()); - stmt.setInt(3, feature.getDeviceTypeId()); + stmt.setString(3, feature.getDeviceType()); // if (conn.getMetaData().getDriverName().contains("H2")) { // stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); // } else { @@ -145,10 +145,7 @@ public class FeatureDAOImpl implements FeatureDAO { stmt = conn.prepareStatement(query); stmt.setInt(1, profile.getProfileId()); stmt.setInt(2, tenantId); - if (stmt.executeUpdate() > 0) { - return true; - } - return false; + return stmt.executeUpdate() > 0; } catch (SQLException e) { throw new FeatureManagerDAOException("Error occurred while deleting the feature related to a profile.", e); } finally { @@ -211,7 +208,7 @@ public class FeatureDAOImpl implements FeatureDAO { try { conn = this.getConnection(); - String query = "SELECT ID, PROFILE_ID, FEATURE_CODE, DEVICE_TYPE_ID, CONTENT FROM DM_PROFILE_FEATURES " + + String query = "SELECT ID, PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT FROM DM_PROFILE_FEATURES " + "WHERE TENANT_ID = ?"; stmt = conn.prepareStatement(query); stmt.setInt(1, tenantId); @@ -221,7 +218,7 @@ public class FeatureDAOImpl implements FeatureDAO { ProfileFeature profileFeature = new ProfileFeature(); profileFeature.setFeatureCode(resultSet.getString("FEATURE_CODE")); - profileFeature.setDeviceTypeId(resultSet.getInt("DEVICE_TYPE_ID")); + profileFeature.setDeviceType(resultSet.getString("DEVICE_TYPE")); profileFeature.setId(resultSet.getInt("ID")); profileFeature.setProfileId(resultSet.getInt("PROFILE_ID")); @@ -272,9 +269,9 @@ public class FeatureDAOImpl implements FeatureDAO { List featureList = new ArrayList(); try { conn = this.getConnection(); - String query = "SELECT f.ID ID, f.NAME NAME, f.CODE CODE, f.DEVICE_TYPE_ID DEVICE_TYPE_ID," + + String query = "SELECT f.ID ID, f.NAME NAME, f.CODE CODE, f.DEVICE_TYPE DEVICE_TYPE," + " f.EVALUATION_RULE EVALUATION_RULE FROM DM_FEATURES f INNER JOIN DM_DEVICE_TYPE d " + - "ON d.ID=f.DEVICE_TYPE_ID WHERE d.NAME = ?"; + "ON d.ID=f.DEVICE_TYPE WHERE d.NAME = ?"; stmt = conn.prepareStatement(query); stmt.setString(1, deviceType); resultSet = stmt.executeQuery(); @@ -306,7 +303,7 @@ public class FeatureDAOImpl implements FeatureDAO { try { conn = this.getConnection(); - String query = "SELECT ID, FEATURE_CODE, DEVICE_TYPE_ID, CONTENT FROM DM_PROFILE_FEATURES " + + String query = "SELECT ID, FEATURE_CODE, DEVICE_TYPE, CONTENT FROM DM_PROFILE_FEATURES " + "WHERE PROFILE_ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); stmt.setInt(1, profileId); @@ -317,7 +314,7 @@ public class FeatureDAOImpl implements FeatureDAO { ProfileFeature profileFeature = new ProfileFeature(); profileFeature.setId(resultSet.getInt("ID")); profileFeature.setFeatureCode(resultSet.getString("FEATURE_CODE")); - profileFeature.setDeviceTypeId(resultSet.getInt("DEVICE_TYPE_ID")); + profileFeature.setDeviceType(resultSet.getString("DEVICE_TYPE")); ByteArrayInputStream bais = null; ObjectInputStream ois = null; diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index 9641dbc516..1530b8edfc 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -48,25 +48,25 @@ public class PolicyDAOImpl implements PolicyDAO { return persistPolicy(policy); } - @Override - public Policy addPolicy(String deviceType, Policy policy) throws PolicyManagerDAOException { - Connection conn; - PreparedStatement stmt = null; - try { - conn = this.getConnection(); - String query = "INSERT INTO DM_DEVICE_TYPE_POLICY (DEVICE_TYPE_ID, POLICY_ID) VALUES (?, ?)"; - stmt = conn.prepareStatement(query); - stmt.setInt(1, getDeviceTypeId(deviceType)); - stmt.setInt(2, policy.getId()); - stmt.executeQuery(); - } catch (SQLException e) { - throw new PolicyManagerDAOException("Error occurred while adding the device type policy to database.", e); - } finally { - PolicyManagementDAOUtil.cleanupResources(stmt, null); - } - return policy; - - } +// @Override +// public Policy addPolicyToDeviceType(String deviceType, Policy policy) throws PolicyManagerDAOException { +// Connection conn; +// PreparedStatement stmt = null; +// try { +// conn = this.getConnection(); +// String query = "INSERT INTO DM_DEVICE_TYPE_POLICY (DEVICE_TYPE_ID, POLICY_ID) VALUES (?, ?)"; +// stmt = conn.prepareStatement(query); +// stmt.setInt(1, getDeviceTypeId(deviceType)); +// stmt.setInt(2, policy.getId()); +// stmt.executeQuery(); +// } catch (SQLException e) { +// throw new PolicyManagerDAOException("Error occurred while adding the device type policy to database.", e); +// } finally { +// PolicyManagementDAOUtil.cleanupResources(stmt, null); +// } +// return policy; +// +// } @Override public Policy addPolicyToRole(List rolesToAdd, Policy policy) throws PolicyManagerDAOException { @@ -831,10 +831,10 @@ public class PolicyDAOImpl implements PolicyDAO { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); try { conn = this.getConnection(); - String query = "INSERT INTO DM_POLICY_CHANGE_MGT (POLICY_ID, DEVICE_TYPE_ID, TENANT_ID) VALUES (?, ?, ?)"; + String query = "INSERT INTO DM_POLICY_CHANGE_MGT (POLICY_ID, DEVICE_TYPE, TENANT_ID) VALUES (?, ?, ?)"; stmt = conn.prepareStatement(query); stmt.setInt(1, policy.getId()); - stmt.setInt(2, policy.getProfile().getDeviceType().getId()); + stmt.setString(2, policy.getProfile().getDeviceType()); stmt.setInt(3, tenantId); stmt.executeUpdate(); @@ -855,11 +855,11 @@ public class PolicyDAOImpl implements PolicyDAO { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); try { conn = this.getConnection(); - String query = "INSERT INTO DM_POLICY_CHANGE_MGT (POLICY_ID, DEVICE_TYPE_ID, TENANT_ID) VALUES (?, ?, ?)"; + String query = "INSERT INTO DM_POLICY_CHANGE_MGT (POLICY_ID, DEVICE_TYPE, TENANT_ID) VALUES (?, ?, ?)"; stmt = conn.prepareStatement(query); for (Policy policy : policies) { stmt.setInt(1, policy.getId()); - stmt.setInt(2, policy.getProfile().getDeviceType().getId()); + stmt.setString(2, policy.getProfile().getDeviceType()); stmt.setInt(3, tenantId); stmt.addBatch(); } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/ProfileDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/ProfileDAOImpl.java index 371c545b35..253cc27a3a 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/ProfileDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/ProfileDAOImpl.java @@ -50,12 +50,12 @@ public class ProfileDAOImpl implements ProfileDAO { try { conn = this.getConnection(); String query = "INSERT INTO DM_PROFILE " + - "(PROFILE_NAME,TENANT_ID, DEVICE_TYPE_ID, CREATED_TIME, UPDATED_TIME) VALUES (?, ?, ?, ?, ?)"; + "(PROFILE_NAME, TENANT_ID, DEVICE_TYPE, CREATED_TIME, UPDATED_TIME) VALUES (?, ?, ?, ?, ?)"; stmt = conn.prepareStatement(query, new String[] {"id"}); stmt.setString(1, profile.getProfileName()); stmt.setInt(2, tenantId); - stmt.setLong(3, profile.getDeviceType().getId()); + stmt.setString(3, profile.getDeviceType()); stmt.setTimestamp(4, profile.getCreatedDate()); stmt.setTimestamp(5, profile.getUpdatedDate()); @@ -95,11 +95,11 @@ public class ProfileDAOImpl implements ProfileDAO { try { conn = this.getConnection(); - String query = "UPDATE DM_PROFILE SET PROFILE_NAME = ? , DEVICE_TYPE_ID = ? , UPDATED_TIME = ? " + + String query = "UPDATE DM_PROFILE SET PROFILE_NAME = ? , DEVICE_TYPE = ? , UPDATED_TIME = ? " + "WHERE ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); stmt.setString(1, profile.getProfileName()); - stmt.setLong(2, profile.getDeviceType().getId()); + stmt.setString(2, profile.getDeviceType()); stmt.setTimestamp(3, profile.getUpdatedDate()); stmt.setInt(4, profile.getProfileId()); stmt.setInt(5, tenantId); @@ -183,8 +183,6 @@ public class ProfileDAOImpl implements ProfileDAO { PreparedStatement stmt = null; ResultSet resultSet = null; Profile profile = new Profile(); - DeviceType deviceType = new DeviceType(); - try { conn = this.getConnection(); String query = "SELECT * FROM DM_PROFILE WHERE ID = ?"; @@ -194,11 +192,10 @@ public class ProfileDAOImpl implements ProfileDAO { while (resultSet.next()) { - deviceType.setId(resultSet.getInt("DEVICE_TYPE_ID")); profile.setProfileId(profileId); profile.setProfileName(resultSet.getString("PROFILE_NAME")); profile.setTenantId(resultSet.getInt("TENANT_ID")); - profile.setDeviceType(deviceType); + profile.setDeviceType(resultSet.getString("DEVICE_TYPE")); profile.setCreatedDate(resultSet.getTimestamp("CREATED_TIME")); profile.setUpdatedDate(resultSet.getTimestamp("UPDATED_TIME")); } @@ -236,11 +233,7 @@ public class ProfileDAOImpl implements ProfileDAO { profile.setTenantId(resultSet.getInt("TENANT_ID")); profile.setCreatedDate(resultSet.getTimestamp("CREATED_TIME")); profile.setUpdatedDate(resultSet.getTimestamp("UPDATED_TIME")); - - DeviceType deviceType = new DeviceType(); - deviceType.setId(resultSet.getInt("DEVICE_TYPE_ID")); - - profile.setDeviceType(deviceType); + profile.setDeviceType(resultSet.getString("DEVICE_TYPE")); profileList.add(profile); } @@ -256,16 +249,16 @@ public class ProfileDAOImpl implements ProfileDAO { } @Override - public List getProfilesOfDeviceType(DeviceType deviceType) throws ProfileManagerDAOException { + public List getProfilesOfDeviceType(String deviceType) throws ProfileManagerDAOException { Connection conn; PreparedStatement stmt = null; ResultSet resultSet = null; List profileList = new ArrayList<>(); try { conn = this.getConnection(); - String query = "SELECT * FROM DM_PROFILE WHERE DEVICE_TYPE_ID = ?"; + String query = "SELECT * FROM DM_PROFILE WHERE DEVICE_TYPE = ?"; stmt = conn.prepareStatement(query); - stmt.setInt(1, deviceType.getId()); + stmt.setString(1, deviceType); resultSet = stmt.executeQuery(); while (resultSet.next()) { @@ -273,7 +266,7 @@ public class ProfileDAOImpl implements ProfileDAO { profile.setProfileId(resultSet.getInt("ID")); profile.setProfileName(resultSet.getString("PROFILE_NAME")); profile.setTenantId(resultSet.getInt("TENANT_ID")); - profile.setDeviceType(deviceType); + profile.setDeviceType(resultSet.getString("DEVICE_TYPE")); profile.setCreatedDate(resultSet.getTimestamp("CREATED_TIME")); profile.setUpdatedDate(resultSet.getTimestamp("UPDATED_TIME")); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java index 2de040e451..9a7eab1c6d 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java @@ -54,7 +54,7 @@ public class DelegationTask implements Task { try { PolicyManager policyManager = new PolicyManagerImpl(); - List deviceTypes = policyManager.applyChangesMadeToPolicies(); + List deviceTypes = policyManager.applyChangesMadeToPolicies(); PolicyCacheManagerImpl.getInstance().rePopulateCache(); @@ -65,9 +65,9 @@ public class DelegationTask implements Task { DeviceManagementProviderService service = PolicyManagementDataHolder.getInstance() .getDeviceManagementService(); List devices = new ArrayList<>(); - for (DeviceType deviceType : deviceTypes) { + for (String deviceType : deviceTypes) { try { - devices.addAll(service.getAllDevices(deviceType.getName())); + devices.addAll(service.getAllDevices(deviceType)); } catch (DeviceManagementException e) { throw new PolicyManagementException("Error occurred while taking the devices", e); } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java index 0d4770a14c..bb2edf3586 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java @@ -179,7 +179,7 @@ public class PolicyFilterImpl implements PolicyFilter { List temp = new ArrayList(); for (Policy policy : policies) { - if (deviceType.equalsIgnoreCase(policy.getProfile().getDeviceType().getName())) { + if (deviceType.equalsIgnoreCase(policy.getProfile().getDeviceType())) { temp.add(policy); } } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/PolicyManager.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/PolicyManager.java index fb8a8df5bf..5e02d98859 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/PolicyManager.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/PolicyManager.java @@ -68,7 +68,7 @@ public interface PolicyManager { void addAppliedPolicyFeaturesToDevice(DeviceIdentifier deviceIdentifier, Policy policy) throws PolicyManagementException; - List applyChangesMadeToPolicies() throws PolicyManagementException; + List applyChangesMadeToPolicies() throws PolicyManagementException; void addAppliedPolicyToDevice(DeviceIdentifier deviceIdentifier, Policy policy) throws PolicyManagementException; diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java index 778de88dad..a8e8250c56 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java @@ -681,7 +681,7 @@ public class PolicyManagerImpl implements PolicyManager { List allPolicies = PolicyCacheManagerImpl.getInstance().getAllPolicies(); for (Policy policy : allPolicies) { - if (policy.getProfile().getDeviceType().getName().equalsIgnoreCase(deviceTypeName)) { + if (policy.getProfile().getDeviceType().equalsIgnoreCase(deviceTypeName)) { policies.add(policy); } } @@ -843,9 +843,9 @@ public class PolicyManagerImpl implements PolicyManager { } @Override - public List applyChangesMadeToPolicies() throws PolicyManagementException { + public List applyChangesMadeToPolicies() throws PolicyManagementException { - List changedDeviceTypes = new ArrayList<>(); + List changedDeviceTypes = new ArrayList<>(); try { //HashMap map = policyDAO.getUpdatedPolicyIdandDeviceTypeId(); List updatedPolicies = new ArrayList<>(); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/ProfileManagerImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/ProfileManagerImpl.java index bdfe27c420..f99de9bc95 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/ProfileManagerImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/ProfileManagerImpl.java @@ -144,8 +144,6 @@ public class ProfileManagerImpl implements ProfileManager { public Profile getProfile(int profileId) throws ProfileManagementException { Profile profile; List featureList; - DeviceType deviceType = null; - try { PolicyManagementDAOFactory.openConnection(); profile = profileDAO.getProfile(profileId); @@ -161,41 +159,12 @@ public class ProfileManagerImpl implements ProfileManager { } finally { PolicyManagementDAOFactory.closeConnection(); } - - try { - DeviceManagementDAOFactory.openConnection(); - deviceType = deviceTypeDAO.getDeviceType(profile.getDeviceType().getId()); - } catch (DeviceManagementDAOException e) { - throw new ProfileManagementException("Error occurred while getting features related profile id (" + - profileId + ")", e); - } catch (SQLException e) { - throw new ProfileManagementException("SQL exception occurred while getting features related profile id (" + - profileId + ")", e); - } finally { - DeviceManagementDAOFactory.closeConnection(); - } - - profile.setDeviceType(deviceType); return profile; } @Override public List getAllProfiles() throws ProfileManagementException { List profileList; - List deviceTypes; - - try { - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - DeviceManagementDAOFactory.openConnection(); - deviceTypes = deviceTypeDAO.getDeviceTypes(tenantId); - } catch (SQLException e) { - throw new ProfileManagementException("Error occurred while opening a connection to the data source", e); - } catch (DeviceManagementDAOException e) { - throw new ProfileManagementException("Error occurred while retrieving device type information", e); - } finally { - DeviceManagementDAOFactory.closeConnection(); - } - try { PolicyManagementDAOFactory.openConnection(); profileList = profileDAO.getAllProfiles(); @@ -210,12 +179,6 @@ public class ProfileManagerImpl implements ProfileManager { } } profile.setProfileFeaturesList(list); - - for (DeviceType deviceType : deviceTypes) { - if (profile.getDeviceType().getId() == deviceType.getId()) { - profile.setDeviceType(deviceType); - } - } } } catch (ProfileManagerDAOException e) { throw new ProfileManagementException("Error occurred while getting profiles", e); @@ -225,29 +188,14 @@ public class ProfileManagerImpl implements ProfileManager { throw new ProfileManagementException("Error occurred while opening a connection to the data source", e); } finally { PolicyManagementDAOFactory.closeConnection(); - // DeviceManagementDAOFactory.closeConnection(); } return profileList; } @Override - public List getProfilesOfDeviceType(String deviceTypeName) throws ProfileManagementException { + public List getProfilesOfDeviceType(String deviceType) throws ProfileManagementException { List profileList; List featureList; - DeviceType deviceType; - - try { - DeviceManagementDAOFactory.openConnection(); - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - deviceType = deviceTypeDAO.getDeviceType(deviceTypeName, tenantId); - } catch (DeviceManagementDAOException e) { - throw new ProfileManagementException("Error occurred while retrieving device type information", e); - } catch (SQLException e) { - throw new ProfileManagementException("Error occurred while opening a connection to the data source", e); - } finally { - DeviceManagementDAOFactory.closeConnection(); - } - try { PolicyManagementDAOFactory.openConnection(); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/MonitoringTestCase.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/MonitoringTestCase.java index 49fe8c062c..5f58374020 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/MonitoringTestCase.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/MonitoringTestCase.java @@ -59,13 +59,25 @@ public class MonitoringTestCase extends BasePolicyManagementDAOTest { } @Test - public void testMonitorDao() throws PolicyManagementException, DeviceManagementException { + public void testMonitorDao() { DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); PolicyManagerService policyManagerService = new PolicyManagerServiceImpl(); - List policies = policyManagerService.getPolicies(ANDROID); - List devices = service.getAllDevices(ANDROID); + List policies = null; + List devices = null; + try { + policies = policyManagerService.getPolicies(ANDROID); + devices = service.getAllDevices(ANDROID); + } catch (PolicyManagementException e) { + log.error("Error occurred while retrieving the list of policies defined against the device type '" + + ANDROID + "'", e); + Assert.fail(); + } catch (DeviceManagementException e) { + log.error("Error occurred while retrieving the list of devices pertaining to the type '" + + ANDROID + "'", e); + Assert.fail(); + } for (Policy policy : policies) { log.debug("Policy Name : " + policy.getPolicyName()); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyDAOTestCase.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyDAOTestCase.java index 9e44132e06..b323735b69 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyDAOTestCase.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyDAOTestCase.java @@ -17,6 +17,7 @@ */ package org.wso2.carbon.policy.mgt.core; +import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; @@ -63,10 +64,11 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { deviceTypeDAO.addDeviceType(DeviceTypeCreator.getDeviceType(), -1234, true); } catch (DeviceManagementDAOException e) { DeviceManagementDAOFactory.rollbackTransaction(); - throw new DeviceManagementDAOException("Error occurred while adding dummy device type", e); + log.error("Error occurred while adding dummy device type", e); + Assert.fail(); } catch (TransactionManagementException e) { - throw new DeviceManagementDAOException("Error occurred while initiating a transaction to add dummy " + - "device type", e); + log.error("Error occurred while initiating a transaction to add dummy device type", e); + Assert.fail(); } finally { DeviceManagementDAOFactory.closeConnection(); } @@ -94,10 +96,12 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { enrollmentDAO.addEnrollment(id, device.getEnrolmentInfo(), -1234); } } catch (TransactionManagementException e) { - throw new PolicyManagementException("Error occurred while adding device enrolment", e); + log.error("Error occurred while adding device enrolment", e); + Assert.fail(); } catch (DeviceManagementDAOException e) { DeviceManagementDAOFactory.rollbackTransaction(); - throw new PolicyManagementException("Error occurred while adding device information", e); + log.error("Error occurred while adding device information", e); + Assert.fail(); } finally { DeviceManagementDAOFactory.closeConnection(); } @@ -107,7 +111,9 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { PolicyManagementDataHolder.getInstance().setDeviceManagementService(service); - log.debug("Printing device taken by calling the service layer with device type."); + if (log.isDebugEnabled()) { + log.debug("Printing device taken by calling the service layer with device type."); + } List devices3 = service.getAllDevices("android"); log.debug("Device list size ...! " + devices3.size()); @@ -141,14 +147,19 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { } @Test(dependsOnMethods = ("addProfileFeatures")) - public void addPolicy() throws PolicyManagementException, ProfileManagementException { + public void addPolicy() { // ProfileManager profileManager = new ProfileManagerImpl(); - Profile profile = ProfileCreator.getProfile5(FeatureCreator.getFeatureList5()); + try { + Profile profile = ProfileCreator.getProfile5(FeatureCreator.getFeatureList5()); // profileManager.addProfile(profile); - PolicyAdministratorPoint pap = new PolicyAdministratorPointImpl(); - policy = PolicyCreator.createPolicy(profile); - policy = pap.addPolicy(policy); - pap.activatePolicy(policy.getId()); + PolicyAdministratorPoint pap = new PolicyAdministratorPointImpl(); + policy = PolicyCreator.createPolicy(profile); + policy = pap.addPolicy(policy); + pap.activatePolicy(policy.getId()); + } catch (PolicyManagementException e) { + log.error("Error occurred while adding the policy", e); + Assert.fail(); + } } @Test(dependsOnMethods = ("addPolicy")) @@ -205,9 +216,15 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { } @Test(dependsOnMethods = ("addNewPolicy")) - public void getPolicies() throws PolicyManagementException { + public void getPolicies() { PolicyAdministratorPoint policyAdministratorPoint = new PolicyAdministratorPointImpl(); - List policyList = policyAdministratorPoint.getPolicies(); + List policyList = null; + try { + policyList = policyAdministratorPoint.getPolicies(); + } catch (PolicyManagementException e) { + log.error("Error occurred while retrieving all the policies registered in the system", e); + Assert.fail(); + } log.debug("----------All policies---------"); @@ -228,10 +245,16 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { } @Test(dependsOnMethods = ("getPolicies")) - public void getDeviceTypeRelatedPolicy() throws PolicyManagementException { + public void getDeviceTypeRelatedPolicy() { PolicyAdministratorPoint policyAdministratorPoint = new PolicyAdministratorPointImpl(); - List policyList = policyAdministratorPoint.getPoliciesOfDeviceType("android"); + List policyList = null; + try { + policyList = policyAdministratorPoint.getPoliciesOfDeviceType("android"); + } catch (PolicyManagementException e) { + log.error("Error occurred while retrieving the list of policies configured upon the platform 'android'", e); + Assert.fail(); + } log.debug("----------Device type related policy---------"); @@ -253,10 +276,17 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { @Test(dependsOnMethods = ("getDeviceTypeRelatedPolicy")) - public void getUserRelatedPolicy() throws PolicyManagementException { - + public void getUserRelatedPolicy() { + String targetUser = "Dilshan"; PolicyAdministratorPoint policyAdministratorPoint = new PolicyAdministratorPointImpl(); - List policyList = policyAdministratorPoint.getPoliciesOfUser("Dilshan"); + List policyList = null; + try { + policyList = policyAdministratorPoint.getPoliciesOfUser(targetUser); + } catch (PolicyManagementException e) { + log.error("Error occurred while retrieving the list of policies assigned to the user '" + + targetUser + "'", e); + Assert.fail(); + } log.debug("----------User related policy---------"); @@ -277,10 +307,17 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest { } @Test(dependsOnMethods = ("getDeviceTypeRelatedPolicy")) - public void getRoleRelatedPolicy() throws PolicyManagementException { - + public void getRoleRelatedPolicy() { + String targetRole = "Test_ROLE_01"; PolicyAdministratorPoint policyAdministratorPoint = new PolicyAdministratorPointImpl(); - List policyList = policyAdministratorPoint.getPoliciesOfRole("Test_ROLE_01"); + List policyList = null; + try { + policyList = policyAdministratorPoint.getPoliciesOfRole(targetRole); + } catch (PolicyManagementException e) { + log.error("Error occurred while retrieving the list of policies defined against the role '" + + targetRole + "'", e); + Assert.fail(); + } log.debug("----------Roles related policy---------"); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java index 28732dad38..af0c3d604c 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java @@ -19,6 +19,7 @@ package org.wso2.carbon.policy.mgt.core; +import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; @@ -54,18 +55,37 @@ public class PolicyEvaluationTestCase extends BasePolicyManagementDAOTest { } @Test - public void activatePolicies() throws PolicyManagementException, TaskException { + public void activatePolicies() { PolicyManagerService policyManagerService = new PolicyManagerServiceImpl(); - PolicyAdministratorPoint administratorPoint = policyManagerService.getPAP(); + PolicyAdministratorPoint administratorPoint = null; + try { + administratorPoint = policyManagerService.getPAP(); + } catch (PolicyManagementException e) { + log.error("Error occurred while loading the policy administration point", e); + Assert.fail(); + } - List policies = policyManagerService.getPolicies(ANDROID); + List policies = null; + try { + policies = policyManagerService.getPolicies(ANDROID); + } catch (PolicyManagementException e) { + log.error("Error occurred while retrieving the list of policies defined against the device type '" + + ANDROID + "'", e); + Assert.fail(); + } for (Policy policy : policies) { log.debug("Policy status : " + policy.getPolicyName() + " - " + policy.isActive() + " - " + policy .isUpdated() + " Policy id : " + policy.getId()); if (!policy.isActive()) { - administratorPoint.activatePolicy(policy.getId()); + try { + administratorPoint.activatePolicy(policy.getId()); + } catch (PolicyManagementException e) { + log.error("Error occurred while activating the policy, which carries the id '" + + policy.getId() + "'", e); + Assert.fail(); + } } } // This cannot be called due to task service cannot be started from the diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileCreator.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileCreator.java index 19574abdf6..9e92c6b7f9 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileCreator.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileCreator.java @@ -29,60 +29,40 @@ public class ProfileCreator { public static Profile getProfile(List features) { Profile profile = new Profile(); - DeviceType deviceType = new DeviceType(); - - deviceType.setId(1); - deviceType.setName("android"); - profile.setProfileFeaturesList(ProfileFeatureCreator.getProfileFeature(features)); profile.setProfileName("Test Profile"); profile.setTenantId(MultitenantConstants.SUPER_TENANT_ID); - profile.setDeviceType(deviceType); + profile.setDeviceType("android"); return profile; } public static Profile getProfile2(List features) { Profile profile = new Profile(); - DeviceType deviceType = new DeviceType(); - - deviceType.setId(1); - deviceType.setName("android"); - profile.setProfileFeaturesList(ProfileFeatureCreator.getProfileFeature(features)); profile.setProfileName("Test Profile 2"); profile.setTenantId(MultitenantConstants.SUPER_TENANT_ID); - profile.setDeviceType(deviceType); + profile.setDeviceType("android"); return profile; } public static Profile getProfile3(List features) { Profile profile = new Profile(); - DeviceType deviceType = new DeviceType(); - - deviceType.setId(1); - deviceType.setName("android"); - profile.setProfileFeaturesList(ProfileFeatureCreator.getProfileFeature(features)); profile.setProfileName("Test Profile 3"); profile.setTenantId(MultitenantConstants.SUPER_TENANT_ID); - profile.setDeviceType(deviceType); + profile.setDeviceType("android"); return profile; } public static Profile getProfile4(List features) { Profile profile = new Profile(); - DeviceType deviceType = new DeviceType(); - - deviceType.setId(1); - deviceType.setName("android"); - profile.setProfileFeaturesList(ProfileFeatureCreator.getProfileFeature(features)); profile.setProfileName("Test Profile 4"); profile.setTenantId(MultitenantConstants.SUPER_TENANT_ID); - profile.setDeviceType(deviceType); + profile.setDeviceType("android"); return profile; } @@ -90,15 +70,10 @@ public class ProfileCreator { public static Profile getProfile5(List features) { Profile profile = new Profile(); - DeviceType deviceType = new DeviceType(); - - deviceType.setId(1); - deviceType.setName("android"); - profile.setProfileFeaturesList(ProfileFeatureCreator.getProfileFeature(features)); profile.setProfileName("Test Profile 5"); profile.setTenantId(MultitenantConstants.SUPER_TENANT_ID); - profile.setDeviceType(deviceType); + profile.setDeviceType("android"); return profile; } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java index e4add057f4..d36d069eb2 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java @@ -38,7 +38,9 @@ public class ProfileFeatureCreator { } else { profileFeature.setContent(getJSON2()); } - profileFeature.setDeviceTypeId(1); + //TODO why assigning a random number below? + //profileFeature.setDeviceTypeId(1); + profileFeature.setDeviceType("android"); profileFeature.setFeatureCode(feature.getCode()); // profileFeature.setContent("mm"); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql index bf0be00ccc..efc3005e2e 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql @@ -141,13 +141,13 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE ( ID INT NOT NULL AUTO_INCREMENT , PROFILE_NAME VARCHAR(45) NOT NULL , TENANT_ID INT NOT NULL , - DEVICE_TYPE_ID INT NOT NULL , + DEVICE_TYPE VARCHAR(20) NOT NULL , CREATED_TIME DATETIME NOT NULL , UPDATED_TIME DATETIME NOT NULL , PRIMARY KEY (ID) , CONSTRAINT DM_PROFILE_DEVICE_TYPE - FOREIGN KEY (DEVICE_TYPE_ID ) - REFERENCES DM_DEVICE_TYPE (ID ) + FOREIGN KEY (DEVICE_TYPE ) + REFERENCES DM_DEVICE_TYPE (NAME ) ON DELETE NO ACTION ON UPDATE NO ACTION ); @@ -202,7 +202,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY ( CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY ( ID INT(11) NOT NULL , - DEVICE_TYPE_ID INT(11) NOT NULL , + DEVICE_TYPE VARCHAR(20) NOT NULL , POLICY_ID INT(11) NOT NULL , PRIMARY KEY (ID) , CONSTRAINT FK_DEVICE_TYPE_POLICY @@ -211,8 +211,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_DEVICE_TYPE_POLICY_DEVICE_TYPE - FOREIGN KEY (DEVICE_TYPE_ID ) - REFERENCES DM_DEVICE_TYPE (ID ) + FOREIGN KEY (DEVICE_TYPE ) + REFERENCES DM_DEVICE_TYPE (NAME) ON DELETE NO ACTION ON UPDATE NO ACTION ); @@ -225,7 +225,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES ( ID INT(11) NOT NULL AUTO_INCREMENT, PROFILE_ID INT(11) NOT NULL, FEATURE_CODE VARCHAR(100) NOT NULL, - DEVICE_TYPE_ID INT NOT NULL, + DEVICE_TYPE VARCHAR(20) NOT NULL, TENANT_ID INT(11) NOT NULL , CONTENT BLOB NULL DEFAULT NULL, PRIMARY KEY (ID), @@ -346,7 +346,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT ( ID INT NOT NULL AUTO_INCREMENT, POLICY_ID INT NOT NULL, - DEVICE_TYPE_ID INT NOT NULL, + DEVICE_TYPE VARCHAR(20) NOT NULL, TENANT_ID INT(11) NOT NULL, PRIMARY KEY (ID) ); diff --git a/components/policy-mgt/org.wso2.carbon.simple.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.simple.policy.decision.point/pom.xml index dccee0db93..aefb36c6f0 100644 --- a/components/policy-mgt/org.wso2.carbon.simple.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.simple.policy.decision.point/pom.xml @@ -3,14 +3,14 @@ org.wso2.carbon.devicemgt policy-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.simple.policy.decision.point - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Simple Policy Decision Point WSO2 Carbon - Simple Policy Decision Point diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml index e884905ad6..895218d930 100644 --- a/components/policy-mgt/pom.xml +++ b/components/policy-mgt/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 policy-mgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Policy Management Component http://wso2.org diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 94f0a0d933..499996b031 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.webapp.authenticator.framework - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT bundle WSO2 Carbon - Web Application Authenticator Framework Bundle WSO2 Carbon - Web Application Authenticator Framework Bundle diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml index 1b1ad5fd55..a4508f3193 100644 --- a/components/webapp-authenticator-framework/pom.xml +++ b/components/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml index 9e1457ed9b..ec5779c3e0 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.application.extension.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - API Management Application Extension Feature http://wso2.org This feature contains an implementation of a api application registration, which takes care of subscription diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml index bdf0eede29..a78b72da69 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - API Management Webapp Publisher Feature http://wso2.org This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index 2db113a8be..88ff4cff42 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt apimgt-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - API Management Extensions Feature http://wso2.org diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml index 98923e7414..41c8151b5c 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml @@ -17,14 +17,12 @@ ~ under the License. --> - + org.wso2.carbon.devicemgt certificate-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml index 3615c1bb77..1113d595ff 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml @@ -17,14 +17,12 @@ ~ under the License. --> - + org.wso2.carbon.devicemgt certificate-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml index d703166608..2f7234005d 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.server.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Certificate Management Server Feature http://wso2.org This feature contains the core bundles required for back-end Certificate Management functionality diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml index 4ee85993f4..69705b0013 100644 --- a/features/certificate-mgt/pom.xml +++ b/features/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Certificate Management Feature http://wso2.org diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml index 35e337b6b8..2c108168d4 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - GCM Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml index f13a64008f..5c79e5967e 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - MQTT Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml index 6417bb335e..0760242826 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - XMPP Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - XMPP Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml index 7020f99f91..f5ce99fa43 100644 --- a/features/device-mgt-extensions/pom.xml +++ b/features/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml index 540991450b..fe8ef48449 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml @@ -3,13 +3,13 @@ org.wso2.carbon.devicemgt device-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.dashboard.feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Device Management Dashboard Analytics Feature WSO2 Carbon - Device Management Dashboard Analytics Feature diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml index 90ace4e4b6..2fd5026746 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.data.publisher.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains bundles related to device analytics data publisher diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml index 2ed84f0600..9d6f5a474b 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml index 1b562c107c..e74e9db2d8 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml @@ -4,14 +4,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Device Management Extensions Feature http://wso2.org This feature contains common extensions used by key device management functionalities diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index 9b6a1eb6a0..0f6bb5f79d 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml index 46a7fe98c8..50e7998447 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.server.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql index bf0be00ccc..3e40d109bd 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -141,13 +141,13 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE ( ID INT NOT NULL AUTO_INCREMENT , PROFILE_NAME VARCHAR(45) NOT NULL , TENANT_ID INT NOT NULL , - DEVICE_TYPE_ID INT NOT NULL , + DEVICE_TYPE VARCHAR(20) NOT NULL , CREATED_TIME DATETIME NOT NULL , UPDATED_TIME DATETIME NOT NULL , PRIMARY KEY (ID) , CONSTRAINT DM_PROFILE_DEVICE_TYPE - FOREIGN KEY (DEVICE_TYPE_ID ) - REFERENCES DM_DEVICE_TYPE (ID ) + FOREIGN KEY (DEVICE_TYPE ) + REFERENCES DM_DEVICE_TYPE (NAME) ON DELETE NO ACTION ON UPDATE NO ACTION ); @@ -202,7 +202,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY ( CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY ( ID INT(11) NOT NULL , - DEVICE_TYPE_ID INT(11) NOT NULL , + DEVICE_TYPE VARCHAR(20) NOT NULL , POLICY_ID INT(11) NOT NULL , PRIMARY KEY (ID) , CONSTRAINT FK_DEVICE_TYPE_POLICY @@ -211,8 +211,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_DEVICE_TYPE_POLICY_DEVICE_TYPE - FOREIGN KEY (DEVICE_TYPE_ID ) - REFERENCES DM_DEVICE_TYPE (ID ) + FOREIGN KEY (DEVICE_TYPE ) + REFERENCES DM_DEVICE_TYPE (NAME) ON DELETE NO ACTION ON UPDATE NO ACTION ); @@ -225,7 +225,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES ( ID INT(11) NOT NULL AUTO_INCREMENT, PROFILE_ID INT(11) NOT NULL, FEATURE_CODE VARCHAR(100) NOT NULL, - DEVICE_TYPE_ID INT NOT NULL, + DEVICE_TYPE VARCHAR(20) NOT NULL, TENANT_ID INT(11) NOT NULL , CONTENT BLOB NULL DEFAULT NULL, PRIMARY KEY (ID), @@ -346,7 +346,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT ( ID INT NOT NULL AUTO_INCREMENT, POLICY_ID INT NOT NULL, - DEVICE_TYPE_ID INT NOT NULL, + DEVICE_TYPE VARCHAR(20) NOT NULL, TENANT_ID INT(11) NOT NULL, PRIMARY KEY (ID) ); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml index 2f9d6f51fe..39b193258c 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 1fcd9c3fe4..7647a97583 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml diff --git a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml index 3f9c04c2e6..a591217aee 100644 --- a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml +++ b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt dynamic-client-registration-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.registration.server.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Dynamic Client Registration Server Feature http://wso2.org This feature contains dynamic client registration features diff --git a/features/dynamic-client-registration/pom.xml b/features/dynamic-client-registration/pom.xml index d683886de4..84536e63ac 100644 --- a/features/dynamic-client-registration/pom.xml +++ b/features/dynamic-client-registration/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt dynamic-client-registration-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Dynamic Client Registration Feature http://wso2.org diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml index 9d623ef830..83b2bfd1f7 100644 --- a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml +++ b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt email-sender-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.email.sender.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Email Sender Feature http://wso2.org This feature contains the core bundles required for email sender related functionality diff --git a/features/email-sender/pom.xml b/features/email-sender/pom.xml index 49064a31eb..baa300a43f 100644 --- a/features/email-sender/pom.xml +++ b/features/email-sender/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt email-sender-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Email Sender Feature http://wso2.org diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml index 82a384b647..744767aecc 100644 --- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml +++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt jwt-client-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.identity.jwt.client.extension.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - JWT Client Feature http://wso2.org This feature contains jwt client implementation from which we can get a access token using the jwt diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml index 852ec20f53..8d8ab3b599 100644 --- a/features/jwt-client/pom.xml +++ b/features/jwt-client/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 jwt-client-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Dynamic Client Registration Feature http://wso2.org diff --git a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml index 12ee5345c5..54a23aed26 100644 --- a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml +++ b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt oauth-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Device Mgt OAuth Extensions Feature http://wso2.org This feature contains devicemgt related OAuth extensions diff --git a/features/oauth-extensions/pom.xml b/features/oauth-extensions/pom.xml index 2deaf76f43..bffb8bdd14 100644 --- a/features/oauth-extensions/pom.xml +++ b/features/oauth-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt oauth-extensions-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Device Management OAuth Extensions Feature http://wso2.org diff --git a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml index fb91690936..1d8a462d4d 100644 --- a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml +++ b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt policy-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.policy.mgt.server.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Policy Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml index b145d09c43..d8b55ee1d2 100644 --- a/features/policy-mgt/pom.xml +++ b/features/policy-mgt/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt policy-mgt-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Policy Management Feature http://wso2.org diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml index 69ad47456c..c5af460171 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.webapp.authenticator.framework.server.feature pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml index 1ec308e68a..5978838b48 100644 --- a/features/webapp-authenticator-framework/pom.xml +++ b/features/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework Feature http://wso2.org diff --git a/pom.xml b/pom.xml index c4f8466689..bc5f7311a2 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt pom - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT WSO2 Carbon - Device Management - Parent http://wso2.org WSO2 Connected Device Manager Components @@ -1796,7 +1796,7 @@ 1.2.11.wso2v5 - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT 4.4.8