X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-os%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Fservice%2FEPAppServiceImpl.java;h=c2385085f0c164b38fce026de030d7480d266818;hb=2845910b34682056c1949f82e39d9205a26554e9;hp=ce10a7c6054d7dcbd8ac06ccf3e1d3eeaf1e433f;hpb=485296388748c1efb5737cf7ae9d4a8254681552;p=portal.git diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java index ce10a7c6..c2385085 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java @@ -100,74 +100,7 @@ public class EPAppServiceImpl extends EPAppCommonServiceImpl implements EPAppSer return userApps; } - @Override - protected void updateRestrictedApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator, - EPUser user) { - synchronized (syncRests) { - boolean result = false; - Session localSession = null; - Transaction transaction = null; - try { - localSession = sessionFactory.openSession(); - transaction = localSession.beginTransaction(); - EPApp app; - if (appId == null) { - app = new EPApp(); - /* - * In the parent class, the UEB code is responsible for generating the - * keys/secret/mailbox but UEB Messaging is not actually being used currently; - * may be used in future at which point we can just remove this method and - * depend on parent class's method So, using UUID generator to generate the - * unique key instead. - */ - String uuidStr = UUID.randomUUID().toString(); - String appKey = uuidStr; - String appSecret = uuidStr; - String appMailboxName = "ECOMP-PORTAL-OUTBOX"; - onboardingApp.setUebTopicName(appMailboxName); - onboardingApp.setUebKey(appKey); - onboardingApp.setUebSecret(appSecret); - } else { - app = (EPApp) localSession.get(EPApp.class, appId); - if (app == null || app.getId() == null) { - // App is already deleted! - transaction.commit(); - localSession.close(); - fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND); - return; - } - } - logger.debug(EELFLoggerDelegate.debugLogger, - "updateRestrictedApp: about to call createAppFromOnboarding"); - createAppFromOnboarding(app, onboardingApp, localSession); - logger.debug(EELFLoggerDelegate.debugLogger, - "updateRestrictedApp: finished calling createAppFromOnboarding"); - localSession.saveOrUpdate(app); - logger.debug(EELFLoggerDelegate.debugLogger, - "updateRestrictedApp: finished calling localSession.saveOrUpdate"); - // Enable or disable all menu items associated with this app - setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId); - logger.debug(EELFLoggerDelegate.debugLogger, - "updateRestrictedApp: finished calling setFunctionalMenuItemsEnabled"); - transaction.commit(); - logger.debug(EELFLoggerDelegate.debugLogger, - "updateRestrictedApp: finished calling transaction.commit"); - result = true; - } catch (Exception e) { - logger.error(EELFLoggerDelegate.errorLogger, "updateRestrictedApp failed", e); - EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e); - EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e); - EcompPortalUtils.rollbackTransaction(transaction, - "updateRestrictedApp rollback, exception = " + e.toString()); - } finally { - EcompPortalUtils.closeLocalSession(localSession, "updateRestrictedApp"); - } - if (!result) { - fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - } - } - } @Override public CambriaTopicManager getTopicManager(List urlList, String key, String secret)