Improve naming

tcdlpds 3 months ago
parent 237fc6f045
commit c4901bf1d3

@ -547,12 +547,12 @@ public interface ApplicationManager {
void deleteApplicationDataOfTenant(int tenantId) throws ApplicationManagementException;
/**
* Delete all application related data of a tenant by tenant Domain
* Delete all application related data of a tenant by tenant Id
*
* @param tenantId Domain of the Tenant
* @param tenantId Id of the Tenant
* @throws ApplicationManagementException thrown if an error occurs when deleting data
*/
void deleteApplicationDataByTenantDomain(int tenantId) throws ApplicationManagementException;
void deleteApplicationDataByTenantId(int tenantId) throws ApplicationManagementException;
/**
* Delete all Application artifacts related to a tenant by Tenant Id
@ -560,5 +560,5 @@ public interface ApplicationManager {
* @param tenantId Id of the Tenant
* @throws ApplicationManagementException thrown if an error occurs when deleting app folders
*/
void deleteApplicationArtifactsByTenantDomain(int tenantId) throws ApplicationManagementException;
void deleteApplicationArtifactsByTenantId(int tenantId) throws ApplicationManagementException;
}

@ -4438,7 +4438,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
}
@Override
public void deleteApplicationDataByTenantDomain(int tenantId) throws ApplicationManagementException {
public void deleteApplicationDataByTenantId(int tenantId) throws ApplicationManagementException {
try {
ConnectionManagerUtil.beginDBTransaction();
vppApplicationDAO.deleteAssociationByTenant(tenantId);
@ -4466,41 +4466,36 @@ public class ApplicationManagerImpl implements ApplicationManager {
ConnectionManagerUtil.commitDBTransaction();
} catch (DBConnectionException e) {
String msg = "Error occurred while observing the database connection to delete applications for tenant with " +
"domain: " + tenantId;
"tenant ID: " + tenantId;
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (ApplicationManagementDAOException e) {
ConnectionManagerUtil.rollbackDBTransaction();
String msg = "Database access error is occurred when getting applications for tenant with domain: "
String msg = "Database access error is occurred when getting applications for tenant with tenant Id: "
+ tenantId;
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (LifeCycleManagementDAOException e) {
ConnectionManagerUtil.rollbackDBTransaction();
String msg = "Error occurred while deleting life-cycle state data of application releases of the tenant"
+ " of domain: " + tenantId ;
+ " of id: " + tenantId ;
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (ReviewManagementDAOException e) {
ConnectionManagerUtil.rollbackDBTransaction();
String msg = "Error occurred while deleting reviews of application releases of the applications"
+ " of tenant of domain: " + tenantId ;
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (Exception e) {
String msg = "Error getting tenant ID from domain: "
+ tenantId;
+ " of tenant of id: " + tenantId ;
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
}
}
@Override
public void deleteApplicationArtifactsByTenantDomain(int tenantId) throws ApplicationManagementException {
public void deleteApplicationArtifactsByTenantId(int tenantId) throws ApplicationManagementException {
try {
DataHolder.getInstance().getApplicationStorageManager().deleteAppFolderOfTenant(tenantId);
} catch (ApplicationStorageManagementException e) {
String msg = "Error deleting app artifacts of tenant of domain: " + tenantId;
String msg = "Error deleting app artifacts of tenant of Id: " + tenantId;
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
}

@ -118,9 +118,9 @@ public class UserManagementAdminServiceImpl implements UserManagementAdminServic
int tenantId = tenantManagerAdminService.getTenantId(tenantDomain);
if (deleteAppArtifacts) {
DeviceMgtAPIUtils.getApplicationManager().deleteApplicationArtifactsByTenantDomain(tenantId);
DeviceMgtAPIUtils.getApplicationManager().deleteApplicationArtifactsByTenantId(tenantId);
}
DeviceMgtAPIUtils.getApplicationManager().deleteApplicationDataByTenantDomain(tenantId);
DeviceMgtAPIUtils.getApplicationManager().deleteApplicationDataByTenantId(tenantId);
DeviceMgtAPIUtils.getDeviceManagementService().deleteDeviceDataByTenantId(tenantId);
DeviceMgtAPIUtils.getTenantManagerAdminService().deleteTenant(tenantDomain);

Loading…
Cancel
Save