Fixing issues in adding license configs

This commit is contained in:
prabathabey 2015-10-18 18:16:52 +05:30
parent 69ba3e83ea
commit c74e27102f

View File

@ -107,15 +107,8 @@ public class RegistryBasedLicenseManager implements LicenseManager {
@Override @Override
public void addLicense(final String deviceType, final License license) throws LicenseManagementException { public void addLicense(final String deviceType, final License license) throws LicenseManagementException {
try { try {
GenericArtifact artifact = this.getGenericArtifact(deviceType, license.getLanguage()); GenericArtifact artifact =
if (artifact != null) { artifactManager.newGovernanceArtifact(new QName("http://www.wso2.com", deviceType));
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));
artifact.setAttribute(DeviceManagementConstants.LicenseProperties.NAME, license.getName()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.NAME, license.getName());
artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VERSION, license.getVersion()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.VERSION, license.getVersion());
artifact.setAttribute(DeviceManagementConstants.LicenseProperties.PROVIDER, license.getProvider()); artifact.setAttribute(DeviceManagementConstants.LicenseProperties.PROVIDER, license.getProvider());