Resolve comments

fix-try-it-meta-info
osh 1 year ago
parent b978e31ab0
commit dae8c09761

@ -88,8 +88,7 @@ public class Extension {
SubscriptionManager,
VisibilityManager,
ApplicationStorageManager,
PlatformStorageManager,
MetadataManagementService
PlatformStorageManager
}
}

@ -458,7 +458,6 @@ public class GenericVppApplicationDAOImpl extends AbstractDAOImpl implements Vp
stmt.setString(5, vppAssociationDTO.getPricingParam());
stmt.setInt(6, vppAssociationDTO.getId());
stmt.setLong(7, tenantId);
stmt.executeUpdate();
if (stmt.executeUpdate() == 1) {
return vppAssociationDTO;
}

@ -27,7 +27,6 @@ import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceP
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.MetadataManagementService;
import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -117,23 +116,19 @@ public class APIUtil {
}
public static MetadataManagementService getMetadataManager() {
try {
if (metadataManagementService == null) {
synchronized (APIUtil.class) {
if (metadataManagementService == null) {
synchronized (APIUtil.class) {
if (metadataManagementService == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
metadataManagementService =
(MetadataManagementService) ctx.getOSGiService(MetadataManagementService.class, null);
if (metadataManagementService == null) {
metadataManagementService = ApplicationManagementUtil.getDeviceManagerInstance();
if (metadataManagementService == null) {
String msg = "MetadataManagement Service service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
String msg = "MetadataManagement Manager service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
}
}
} catch (Exception e) {
String msg = "Error occurred while getting the vpp manager";
log.error(msg);
throw new IllegalStateException(msg);
}
return metadataManagementService;
}

@ -210,14 +210,6 @@ public class ApplicationManagementUtil {
// TODO: implement as an extension
return new VppApplicationManagerImpl();
}
public static MetadataManagementService getDeviceManagerInstance() throws InvalidConfigurationException {
ConfigurationManager configurationManager = ConfigurationManager.getInstance();
Extension extension = configurationManager.getExtension(Extension.Name.MetadataManagementService);
return getInstance(extension, MetadataManagementService.class);
}
/**
* This is useful to delete application artifacts if any error occurred while creating release/application
* after uploading the artifacts

Loading…
Cancel
Save