From c74e27102f90ea979cde2238ca0cdbdf572ccdb2 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Sun, 18 Oct 2015 18:16:52 +0530 Subject: [PATCH] Fixing issues in adding license configs --- .../mgt/registry/RegistryBasedLicenseManager.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/license/mgt/registry/RegistryBasedLicenseManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/license/mgt/registry/RegistryBasedLicenseManager.java index 7eb9f200a1..a70f62d79e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/license/mgt/registry/RegistryBasedLicenseManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/license/mgt/registry/RegistryBasedLicenseManager.java @@ -107,15 +107,8 @@ public class RegistryBasedLicenseManager implements LicenseManager { @Override public void addLicense(final String deviceType, final License license) throws LicenseManagementException { try { - GenericArtifact artifact = this.getGenericArtifact(deviceType, license.getLanguage()); - if (artifact != null) { - if (log.isDebugEnabled()) { - log.debug("Generic artifact is null for '" + deviceType + "' device type. Hence license does not " + - "have content"); - } - return; - } - artifact = artifactManager.newGovernanceArtifact(new QName("http://www.wso2.com", deviceType)); + GenericArtifact artifact = + artifactManager.newGovernanceArtifact(new QName("http://www.wso2.com", deviceType)); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.NAME, license.getName()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VERSION, license.getVersion()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.PROVIDER, license.getProvider());