Fixing issues in adding license configs

4.x.x
prabathabey 9 years ago
parent 69ba3e83ea
commit c74e27102f

@ -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());

Loading…
Cancel
Save