Fix isues in app release update

merge-requests/93/head
lasanthaDLPDS 5 years ago
parent 48d606bdde
commit 1b0983dafb

@ -150,8 +150,7 @@ public interface ApplicationManager {
* @param stateName Lifecycle state to change the app
* @throws ApplicationManagementException ApplicationDTO Management Exception.
*/
void changeLifecycleState(String releaseUuid, String stateName)
throws ApplicationManagementException;
void changeLifecycleState(String releaseUuid, String stateName) throws ApplicationManagementException;
/**
* To update release images such as icons, banner and screenshots.

@ -64,8 +64,7 @@ public interface LifecycleStateDAO {
*
* @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception.
*/
void addLifecycleState(LifecycleState state, int appReleaseId, int tenantId)
throws LifeCycleManagementDAOException;
void addLifecycleState(LifecycleState state, int appReleaseId, int tenantId) throws LifeCycleManagementDAOException;
/**
* To delete lifecycle state data of specific application release.

@ -102,7 +102,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
statement.setBoolean(15, applicationRelease.getIsSharedWithAllTenants());
statement.setString(16, applicationRelease.getMetaData());
statement.setString(17, applicationRelease.getSupportedOsVersions());
statement.setString(18, applicationRelease.getCurrentState());
statement.setString(18, applicationRelease.getCurrentState().toUpperCase());
statement.setInt(19, appId);
statement.executeUpdate();
resultSet = statement.getGeneratedKeys();
@ -474,9 +474,9 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
statement.setBoolean(14, applicationReleaseDTO.getIsSharedWithAllTenants());
statement.setString(15, applicationReleaseDTO.getMetaData());
statement.setString(16, applicationReleaseDTO.getSupportedOsVersions());
statement.setString(17, applicationReleaseDTO.getCurrentState());
statement.setInt(18, tenantId);
statement.setInt(19, applicationReleaseDTO.getId());
statement.setString(17, applicationReleaseDTO.getCurrentState().toUpperCase());
statement.setInt(18, applicationReleaseDTO.getId());
statement.setInt(19, tenantId);
if (statement.executeUpdate() == 0) {
return null;
}

@ -1625,7 +1625,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
lifecycleState.setPreviousState(applicationReleaseDTO.getCurrentState());
lifecycleState.setUpdatedBy(userName);
applicationReleaseDTO.setCurrentState(stateName);
this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId);
if (this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId) == null) {
String msg = "Application release updating is failed/.";
log.error(msg);
throw new ApplicationManagementException(msg);
}
this.lifecycleStateDAO.addLifecycleState(lifecycleState, applicationReleaseDTO.getId(), tenantId);
ConnectionManagerUtil.commitDBTransaction();
} else {

@ -931,12 +931,12 @@ public interface ApplicationManagementPublisherAPI {
name = "oldTagName",
value = "Existing Tag Name",
required = true)
@PathParam("oldTagName") String oldTagName,
@QueryParam("from") String oldTagName,
@ApiParam(
name = "tag",
name = "newTagName",
value = "Modifying Tag Name",
required = true)
@QueryParam("tag") String newTagName
@QueryParam("to") String newTagName
);
@GET

@ -551,10 +551,10 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
@PUT
@Override
@Consumes("application/json")
@Path("/tags/{oldTagName}")
@Path("/tags/rename")
public Response modifyTagName(
@PathParam("oldTagName") String oldTagName,
@QueryParam("tag") String newTagName) {
@QueryParam("from") String oldTagName,
@QueryParam("to") String newTagName) {
ApplicationManager applicationManager = APIUtil.getApplicationManager();
try {
applicationManager.updateTag(oldTagName, newTagName);

Loading…
Cancel
Save