Fix building issue

device-task-configuration
Rajitha Kumara 8 months ago
parent 3798134011
commit a54d2b0924

@ -371,11 +371,9 @@ public interface ApplicationManager {
* *
* @param releaseUuid UUID of the application release. * @param releaseUuid UUID of the application release.
* @param entAppReleaseWrapper {@link ApplicationReleaseDTO} * @param entAppReleaseWrapper {@link ApplicationReleaseDTO}
* @param applicationArtifact {@link ApplicationArtifact}
* @return If the application release is updated correctly True returns, otherwise retuen False * @return If the application release is updated correctly True returns, otherwise retuen False
*/ */
ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper, ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper) throws ApplicationManagementException;
ApplicationArtifact applicationArtifact) throws ApplicationManagementException;
/** /**
@ -392,22 +390,18 @@ public interface ApplicationManager {
* *
* @param releaseUuid UUID of the application release. * @param releaseUuid UUID of the application release.
* @param webAppReleaseWrapper {@link ApplicationReleaseDTO} * @param webAppReleaseWrapper {@link ApplicationReleaseDTO}
* @param applicationArtifact {@link ApplicationArtifact}
* @return If the application release is updated correctly True returns, otherwise retuen False * @return If the application release is updated correctly True returns, otherwise retuen False
*/ */
ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper, ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper) throws ApplicationManagementException;
ApplicationArtifact applicationArtifact) throws ApplicationManagementException;
/** /**
* Use to update existing custom app release * Use to update existing custom app release
* *
* @param releaseUuid UUID of the application release. * @param releaseUuid UUID of the application release.
* @param customAppReleaseWrapper {@link ApplicationReleaseDTO} * @param customAppReleaseWrapper {@link ApplicationReleaseDTO}
* @param applicationArtifact {@link ApplicationArtifact}
* @return If the application release is updated correctly True returns, otherwise retuen False * @return If the application release is updated correctly True returns, otherwise retuen False
*/ */
ApplicationRelease updateCustomAppRelease(String releaseUuid, CustomAppReleaseWrapper customAppReleaseWrapper, ApplicationRelease updateCustomAppRelease(String releaseUuid, CustomAppReleaseWrapper customAppReleaseWrapper) throws ApplicationManagementException;
ApplicationArtifact applicationArtifact) throws ApplicationManagementException;
/** /**
* To validate the application creating request * To validate the application creating request

@ -83,10 +83,7 @@
io.entgra.device.mgt.core.apimgt.application.extension.*, io.entgra.device.mgt.core.apimgt.application.extension.*,
org.apache.commons.httpclient, org.apache.commons.httpclient,
org.apache.commons.httpclient.methods, org.apache.commons.httpclient.methods,
org.apache.commons.validator.routines, org.apache.commons.validator.routines
okhttp3.OkHttpClient,
okhttp3.Request,
okhttp3.Response
</Import-Package> </Import-Package>
<Embed-Dependency>apk-parser;scope=compile|runtime;inline=false</Embed-Dependency> <Embed-Dependency>apk-parser;scope=compile|runtime;inline=false</Embed-Dependency>
<Export-Package> <Export-Package>
@ -376,6 +373,16 @@
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
<scope>compile</scope> <scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

@ -3324,11 +3324,13 @@ public class ApplicationManagerImpl implements ApplicationManager {
} }
@Override @Override
public ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper, public ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper) throws ApplicationManagementException {
ApplicationArtifact applicationArtifact) throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
try { try {
ApplicationArtifact applicationArtifact = ApplicationManagementUtil.
constructApplicationArtifact(entAppReleaseWrapper.getIconLink(), entAppReleaseWrapper.getScreenshotLinks(),
entAppReleaseWrapper.getArtifactLink(), entAppReleaseWrapper.getBannerLink());
ConnectionManagerUtil.beginDBTransaction(); ConnectionManagerUtil.beginDBTransaction();
ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId);
DeviceType deviceTypeObj = APIUtil.getDeviceTypeData(applicationDTO.getDeviceTypeId()); DeviceType deviceTypeObj = APIUtil.getDeviceTypeData(applicationDTO.getDeviceTypeId());
@ -3395,6 +3397,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
+ "UUID:" + releaseUuid; + "UUID:" + releaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);
} catch (MalformedURLException e) {
throw new ApplicationManagementException("Malformed downloadable URL received for the Public app " +
"release UUID: " + releaseUuid);
} catch (FileDownloaderServiceException e) {
throw new ApplicationManagementException("Error encountered while downloading artifact for the Public app " +
"release UUID: " + releaseUuid);
} finally { } finally {
ConnectionManagerUtil.closeDBConnection(); ConnectionManagerUtil.closeDBConnection();
} }
@ -3405,7 +3413,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
try { try {
ApplicationArtifact applicationArtifact = ApplicationManagementUtil.constructApplicationArtifact(publicAppReleaseWrapper.getIconLink(), publicAppReleaseWrapper.getScreenshotLinks(), null, null); ApplicationArtifact applicationArtifact = ApplicationManagementUtil.
constructApplicationArtifact(publicAppReleaseWrapper.getIconLink(), publicAppReleaseWrapper.getScreenshotLinks(),
null, publicAppReleaseWrapper.getBannerLink());
ConnectionManagerUtil.beginDBTransaction(); ConnectionManagerUtil.beginDBTransaction();
ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId);
validateAppReleaseUpdating(publicAppReleaseWrapper, applicationDTO, applicationArtifact, validateAppReleaseUpdating(publicAppReleaseWrapper, applicationDTO, applicationArtifact,
@ -3476,11 +3486,13 @@ public class ApplicationManagerImpl implements ApplicationManager {
} }
@Override @Override
public ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper, public ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper) throws ApplicationManagementException {
ApplicationArtifact applicationArtifact) throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
try { try {
ApplicationArtifact applicationArtifact = ApplicationManagementUtil.
constructApplicationArtifact(webAppReleaseWrapper.getIconLink(), webAppReleaseWrapper.getScreenshotLinks(),
null, webAppReleaseWrapper.getBannerLink());
ConnectionManagerUtil.beginDBTransaction(); ConnectionManagerUtil.beginDBTransaction();
ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId);
validateAppReleaseUpdating(webAppReleaseWrapper, applicationDTO, applicationArtifact, validateAppReleaseUpdating(webAppReleaseWrapper, applicationDTO, applicationArtifact,
@ -3535,18 +3547,27 @@ public class ApplicationManagerImpl implements ApplicationManager {
+ "release UUID:" + releaseUuid; + "release UUID:" + releaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);
} catch (MalformedURLException e) {
throw new ApplicationManagementException("Malformed downloadable URL received for the Public app " +
"release UUID: " + releaseUuid);
} catch (FileDownloaderServiceException e) {
throw new ApplicationManagementException("Error encountered while downloading artifact for the Public app " +
"release UUID: " + releaseUuid);
} finally { } finally {
ConnectionManagerUtil.closeDBConnection(); ConnectionManagerUtil.closeDBConnection();
} }
} }
@Override @Override
public ApplicationRelease updateCustomAppRelease(String releaseUuid, public ApplicationRelease updateCustomAppRelease(String releaseUuid, CustomAppReleaseWrapper customAppReleaseWrapper)
CustomAppReleaseWrapper customAppReleaseWrapper, ApplicationArtifact applicationArtifact)
throws ApplicationManagementException { throws ApplicationManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager(); ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
try { try {
ApplicationArtifact applicationArtifact = ApplicationManagementUtil.
constructApplicationArtifact(customAppReleaseWrapper.getIconLink(),
customAppReleaseWrapper.getScreenshotLinks(), customAppReleaseWrapper.getArtifactLink(),
customAppReleaseWrapper.getBannerLink());
ConnectionManagerUtil.beginDBTransaction(); ConnectionManagerUtil.beginDBTransaction();
ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId);
AtomicReference<ApplicationReleaseDTO> applicationReleaseDTO = new AtomicReference<>( AtomicReference<ApplicationReleaseDTO> applicationReleaseDTO = new AtomicReference<>(
@ -3665,6 +3686,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
+ "UUID:" + releaseUuid; + "UUID:" + releaseUuid;
log.error(msg, e); log.error(msg, e);
throw new ApplicationManagementException(msg, e); throw new ApplicationManagementException(msg, e);
} catch (MalformedURLException e) {
throw new ApplicationManagementException("Malformed downloadable URL received for the Public app " +
"release UUID: " + releaseUuid);
} catch (FileDownloaderServiceException e) {
throw new ApplicationManagementException("Error encountered while downloading artifact for the Public app " +
"release UUID: " + releaseUuid);
} finally { } finally {
ConnectionManagerUtil.closeDBConnection(); ConnectionManagerUtil.closeDBConnection();
} }

@ -2177,8 +2177,8 @@
<json.smart.version>1.3</json.smart.version> <json.smart.version>1.3</json.smart.version>
<google.gson.version>2.8.5</google.gson.version> <google.gson.version>2.8.5</google.gson.version>
<google.guava.version>31.0.1-jre</google.guava.version> <google.guava.version>31.0.1-jre</google.guava.version>
<squareup.okhttp3.version>4.6.0</squareup.okhttp3.version> <squareup.okhttp3.version>4.12.0</squareup.okhttp3.version>
<okio.version>2.6.0</okio.version> <okio.version>3.6.0</okio.version>
<github.openfeign.version>9.3.1</github.openfeign.version> <github.openfeign.version>9.3.1</github.openfeign.version>
<jsr311.version>1.1.1</jsr311.version> <jsr311.version>1.1.1</jsr311.version>
<commons.logging.version>1.2</commons.logging.version> <commons.logging.version>1.2</commons.logging.version>

Loading…
Cancel
Save