From 7f535078ef80a7b7efa3e3325bfccb994fbd00e8 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Thu, 31 Aug 2017 15:16:38 -0400 Subject: Rename packages to org.onap in 1.4.0-SNAPSHOT 19 - remove openecomp 72 - remediate Sonar scan issues 79 - removed unwanted left menu under Report 90 - apply approved license text Issue: PORTAL-19, PORTAL-72, PORTAL-79, PORTAL-90 Change-Id: I41a0ef5fba623d2242574bd15f2d9fb8029a496c Signed-off-by: Christopher Lott (cl778h) --- .../java/org/onap/portalsdk/core/FusionObject.java | 129 ++ .../onap/portalsdk/core/auth/LoginStrategy.java | 158 +++ .../org/onap/portalsdk/core/command/LoginBean.java | 211 ++++ .../portalsdk/core/command/PostDroolsBean.java | 69 ++ .../portalsdk/core/command/PostSearchBean.java | 393 +++++++ .../onap/portalsdk/core/command/UserRowBean.java | 103 ++ .../portalsdk/core/command/support/SearchBase.java | 288 +++++ .../core/command/support/SearchResult.java | 85 ++ .../org/onap/portalsdk/core/conf/AppConfig.java | 382 ++++++ .../onap/portalsdk/core/conf/AppInitializer.java | 88 ++ .../org/onap/portalsdk/core/conf/Configurable.java | 56 + .../core/conf/HibernateConfiguration.java | 162 +++ .../core/conf/HibernateMappingLocatable.java | 61 + .../core/controller/FusionBaseController.java | 153 +++ .../core/controller/RestrictedBaseController.java | 68 ++ .../RestrictedRESTfulBaseController.java | 68 ++ .../controller/UnRestrictedBaseController.java | 58 + .../org/onap/portalsdk/core/dao/AbstractDao.java | 80 ++ .../org/onap/portalsdk/core/dao/ProfileDao.java | 47 + .../onap/portalsdk/core/dao/ProfileDaoImpl.java | 69 ++ .../core/dao/hibernate/ModelOperationsCommon.java | 471 ++++++++ .../onap/portalsdk/core/dao/support/FusionDao.java | 53 + .../java/org/onap/portalsdk/core/domain/App.java | 224 ++++ .../org/onap/portalsdk/core/domain/AuditLog.java | 124 ++ .../portalsdk/core/domain/BroadcastMessage.java | 142 +++ .../org/onap/portalsdk/core/domain/DomainVo.java | 195 ++++ .../org/onap/portalsdk/core/domain/FnMenu.java | 159 +++ .../org/onap/portalsdk/core/domain/FusionVo.java | 45 + .../org/onap/portalsdk/core/domain/LoginBean.java | 205 ++++ .../org/onap/portalsdk/core/domain/Lookup.java | 99 ++ .../org/onap/portalsdk/core/domain/LuCountry.java | 105 ++ .../org/onap/portalsdk/core/domain/LuState.java | 88 ++ .../org/onap/portalsdk/core/domain/LuTimeZone.java | 97 ++ .../java/org/onap/portalsdk/core/domain/Menu.java | 178 +++ .../org/onap/portalsdk/core/domain/MenuData.java | 90 ++ .../org/onap/portalsdk/core/domain/Profile.java | 114 ++ .../java/org/onap/portalsdk/core/domain/Role.java | 192 +++ .../onap/portalsdk/core/domain/RoleFunction.java | 89 ++ .../onap/portalsdk/core/domain/UrlsAccessible.java | 96 ++ .../portalsdk/core/domain/UrlsAccessibleKey.java | 108 ++ .../java/org/onap/portalsdk/core/domain/User.java | 602 ++++++++++ .../org/onap/portalsdk/core/domain/UserApp.java | 129 ++ .../org/onap/portalsdk/core/domain/UserAppId.java | 106 ++ .../core/domain/sessionmgt/TimeoutVO.java | 81 ++ .../portalsdk/core/domain/support/Attribute.java | 80 ++ .../core/domain/support/CollaborateList.java | 74 ++ .../portalsdk/core/domain/support/Container.java | 349 ++++++ .../onap/portalsdk/core/domain/support/Domain.java | 277 +++++ .../portalsdk/core/domain/support/DomainVo.java | 184 +++ .../portalsdk/core/domain/support/Element.java | 183 +++ .../core/domain/support/ElementDetails.java | 89 ++ .../core/domain/support/FusionCommand.java | 57 + .../onap/portalsdk/core/domain/support/Layout.java | 1227 ++++++++++++++++++++ .../portalsdk/core/domain/support/NameValueId.java | 112 ++ .../portalsdk/core/domain/support/Position.java | 58 + .../onap/portalsdk/core/domain/support/Size.java | 58 + .../portalsdk/core/drools/DroolsRuleService.java | 45 + .../core/drools/DroolsRuleServiceImpl.java | 76 ++ .../core/exception/FusionExceptionResolver.java | 68 ++ .../core/exception/SessionExpiredException.java | 53 + .../exception/UrlAccessRestrictedException.java | 53 + .../core/exception/support/FusionException.java | 42 + .../exception/support/FusionRuntimeException.java | 53 + .../core/interceptor/ResourceInterceptor.java | 189 +++ .../interceptor/SessionTimeoutInterceptor.java | 121 ++ .../core/interfaces/SecurityInterface.java | 42 + .../core/listener/ApplicationContextListener.java | 67 ++ .../listener/CollaborateListBindingListener.java | 79 ++ .../core/listener/UserSessionListener.java | 80 ++ .../portalsdk/core/lm/FusionLicenseManager.java | 78 ++ .../core/lm/FusionLicenseManagerUtils.java | 91 ++ .../onap/portalsdk/core/lm/LicenseableClass.java | 56 + .../portalsdk/core/logging/aspect/AuditLog.java | 50 + .../core/logging/aspect/EELFLoggerAdvice.java | 252 ++++ .../core/logging/aspect/EELFLoggerAspect.java | 106 ++ .../portalsdk/core/logging/aspect/MetricsLog.java | 50 + .../core/logging/format/AlarmSeverityEnum.java | 46 + .../core/logging/format/AppMessagesEnum.java | 267 +++++ .../logging/format/ApplicationCodes.properties | 239 ++++ .../core/logging/format/AuditLogFormatter.java | 124 ++ .../core/logging/format/ErrorCodesEnum.java | 107 ++ .../core/logging/format/ErrorSeverityEnum.java | 45 + .../core/logging/format/ErrorTypeEnum.java | 47 + .../core/logging/logic/EELFLoggerDelegate.java | 502 ++++++++ .../org/onap/portalsdk/core/menu/MenuBuilder.java | 181 +++ .../onap/portalsdk/core/menu/MenuProperties.java | 132 +++ .../core/objectcache/AbstractCacheManager.java | 78 ++ .../core/objectcache/jcs/JCSCacheEventHandler.java | 78 ++ .../core/objectcache/jcs/JCSCacheManager.java | 204 ++++ .../objectcache/support/FusionCacheManager.java | 54 + .../core/onboarding/client/AppContextManager.java | 63 + .../core/onboarding/session/TestClass.java | 42 + .../portalsdk/core/onboarding/sso/TestClass.java | 42 + .../portalsdk/core/onboarding/ueb/Consumer.java | 173 +++ .../core/onboarding/ueb/FunctionalMenu.java | 79 ++ .../onap/portalsdk/core/onboarding/ueb/Helper.java | 82 ++ .../portalsdk/core/onboarding/ueb/Publisher.java | 143 +++ .../core/onboarding/ueb/PublisherList.java | 95 ++ .../core/onboarding/ueb/TopicManager.java | 151 +++ .../core/onboarding/ueb/UebException.java | 83 ++ .../portalsdk/core/onboarding/ueb/UebManager.java | 376 ++++++ .../onap/portalsdk/core/onboarding/ueb/UebMsg.java | 137 +++ .../portalsdk/core/onboarding/ueb/UebMsgTypes.java | 46 + .../onboarding/ueb/WaitingRequestersQueueList.java | 91 ++ .../core/restful/client/HttpStatusAndResponse.java | 60 + .../core/restful/client/PortalRestClientBase.java | 191 +++ .../restful/client/SharedContextRestClient.java | 366 ++++++ .../portalsdk/core/scheduler/CoreRegister.java | 108 ++ .../portalsdk/core/scheduler/CronRegistry.java | 142 +++ .../portalsdk/core/scheduler/Registerable.java | 48 + .../core/service/AccessConfiguration.java | 164 +++ .../onap/portalsdk/core/service/AppService.java | 79 ++ .../portalsdk/core/service/AppServiceImpl.java | 112 ++ .../onap/portalsdk/core/service/AuditService.java | 55 + .../portalsdk/core/service/AuditServiceImpl.java | 68 ++ .../portalsdk/core/service/BroadcastService.java | 54 + .../core/service/BroadcastServiceImpl.java | 269 +++++ .../core/service/CentralAccessCondition.java | 65 ++ .../portalsdk/core/service/DataAccessService.java | 98 ++ .../core/service/DataAccessServiceImpl.java | 442 +++++++ .../portalsdk/core/service/ElementLinkService.java | 308 +++++ .../portalsdk/core/service/ElementMapService.java | 1047 +++++++++++++++++ .../onap/portalsdk/core/service/FnMenuService.java | 70 ++ .../portalsdk/core/service/FnMenuServiceImpl.java | 137 +++ .../core/service/FunctionalMenuListService.java | 51 + .../FunctionalMenuListServiceCentralizedImpl.java | 68 ++ .../service/FunctionalMenuListServiceImpl.java | 67 ++ .../onap/portalsdk/core/service/LdapService.java | 49 + .../portalsdk/core/service/LdapServiceImpl.java | 286 +++++ .../core/service/LocalAccessCondition.java | 56 + .../onap/portalsdk/core/service/LoginService.java | 72 ++ .../core/service/LoginServiceCentralizedImpl.java | 233 ++++ .../portalsdk/core/service/LoginServiceImpl.java | 218 ++++ .../portalsdk/core/service/PostDroolsService.java | 52 + .../core/service/PostDroolsServiceImpl.java | 204 ++++ .../portalsdk/core/service/PostSearchService.java | 55 + .../core/service/PostSearchServiceImpl.java | 225 ++++ .../portalsdk/core/service/ProfileService.java | 78 ++ .../service/ProfileServiceCentralizedImpl.java | 105 ++ .../portalsdk/core/service/ProfileServiceImpl.java | 89 ++ .../core/service/RestApiRequestBuilder.java | 170 +++ .../onap/portalsdk/core/service/RoleService.java | 147 +++ .../core/service/RoleServiceCentralizedAccess.java | 217 ++++ .../portalsdk/core/service/RoleServiceImpl.java | 187 +++ .../onap/portalsdk/core/service/UrlAccessImpl.java | 81 ++ .../portalsdk/core/service/UrlAccessService.java | 52 + .../portalsdk/core/service/UserProfileService.java | 51 + .../core/service/UserProfileServiceImpl.java | 132 +++ .../onap/portalsdk/core/service/UserService.java | 67 ++ .../core/service/UserServiceCentalizedImpl.java | 127 ++ .../portalsdk/core/service/UserServiceImpl.java | 60 + .../core/service/WebServiceCallService.java | 44 + .../core/service/WebServiceCallServiceImpl.java | 207 ++++ .../core/service/support/FusionService.java | 45 + .../core/service/support/ServiceLocator.java | 45 + .../core/service/support/ServiceLocatorImpl.java | 122 ++ .../org/onap/portalsdk/core/util/CacheManager.java | 61 + .../onap/portalsdk/core/util/EncDecUtilTest.java | 130 +++ .../org/onap/portalsdk/core/util/JSONUtil.java | 74 ++ .../onap/portalsdk/core/util/SystemProperties.java | 351 ++++++ .../org/onap/portalsdk/core/util/UsageUtils.java | 110 ++ .../org/onap/portalsdk/core/util/YamlUtils.java | 90 ++ .../core/web/socket/PeerBroadcastSocket.java | 122 ++ .../portalsdk/core/web/socket/WebRTCSocket.java | 161 +++ .../onap/portalsdk/core/web/support/AppUtils.java | 231 ++++ .../core/web/support/ControllerProperties.java | 59 + .../core/web/support/FeedbackMessage.java | 98 ++ .../portalsdk/core/web/support/JsonMessage.java | 136 +++ .../portalsdk/core/web/support/MessagesList.java | 110 ++ .../onap/portalsdk/core/web/support/UserUtils.java | 413 +++++++ .../org/openecomp/portalsdk/core/FusionObject.java | 111 -- .../portalsdk/core/auth/LoginStrategy.java | 140 --- .../portalsdk/core/command/LoginBean.java | 193 --- .../portalsdk/core/command/PostDroolsBean.java | 51 - .../portalsdk/core/command/PostSearchBean.java | 375 ------ .../portalsdk/core/command/UserRowBean.java | 85 -- .../portalsdk/core/command/support/SearchBase.java | 270 ----- .../core/command/support/SearchResult.java | 67 -- .../openecomp/portalsdk/core/conf/AppConfig.java | 364 ------ .../portalsdk/core/conf/AppInitializer.java | 69 -- .../portalsdk/core/conf/Configurable.java | 38 - .../core/conf/HibernateConfiguration.java | 139 --- .../core/conf/HibernateMappingLocatable.java | 43 - .../core/controller/FusionBaseController.java | 135 --- .../core/controller/RestrictedBaseController.java | 50 - .../RestrictedRESTfulBaseController.java | 50 - .../controller/UnRestrictedBaseController.java | 40 - .../openecomp/portalsdk/core/dao/AbstractDao.java | 62 - .../openecomp/portalsdk/core/dao/ProfileDao.java | 29 - .../portalsdk/core/dao/ProfileDaoImpl.java | 51 - .../core/dao/hibernate/ModelOperationsCommon.java | 453 -------- .../portalsdk/core/dao/support/FusionDao.java | 36 - .../org/openecomp/portalsdk/core/domain/App.java | 206 ---- .../openecomp/portalsdk/core/domain/AuditLog.java | 106 -- .../portalsdk/core/domain/BroadcastMessage.java | 124 -- .../openecomp/portalsdk/core/domain/DomainVo.java | 177 --- .../openecomp/portalsdk/core/domain/FnMenu.java | 141 --- .../openecomp/portalsdk/core/domain/FusionVo.java | 27 - .../openecomp/portalsdk/core/domain/LoginBean.java | 187 --- .../openecomp/portalsdk/core/domain/Lookup.java | 85 -- .../openecomp/portalsdk/core/domain/LuCountry.java | 87 -- .../openecomp/portalsdk/core/domain/LuState.java | 70 -- .../portalsdk/core/domain/LuTimeZone.java | 79 -- .../org/openecomp/portalsdk/core/domain/Menu.java | 160 --- .../openecomp/portalsdk/core/domain/MenuData.java | 72 -- .../openecomp/portalsdk/core/domain/Profile.java | 96 -- .../org/openecomp/portalsdk/core/domain/Role.java | 174 --- .../portalsdk/core/domain/RoleFunction.java | 71 -- .../portalsdk/core/domain/UrlsAccessible.java | 83 -- .../portalsdk/core/domain/UrlsAccessibleKey.java | 90 -- .../org/openecomp/portalsdk/core/domain/User.java | 584 ---------- .../openecomp/portalsdk/core/domain/UserApp.java | 111 -- .../openecomp/portalsdk/core/domain/UserAppId.java | 88 -- .../core/domain/sessionmgt/TimeoutVO.java | 63 - .../portalsdk/core/domain/support/Attribute.java | 62 - .../core/domain/support/CollaborateList.java | 56 - .../portalsdk/core/domain/support/Container.java | 331 ------ .../portalsdk/core/domain/support/Domain.java | 259 ----- .../portalsdk/core/domain/support/DomainVo.java | 166 --- .../portalsdk/core/domain/support/Element.java | 165 --- .../core/domain/support/ElementDetails.java | 71 -- .../core/domain/support/FusionCommand.java | 39 - .../portalsdk/core/domain/support/Layout.java | 1209 ------------------- .../portalsdk/core/domain/support/NameValueId.java | 94 -- .../portalsdk/core/domain/support/Position.java | 40 - .../portalsdk/core/domain/support/Size.java | 40 - .../portalsdk/core/drools/DroolsRuleService.java | 27 - .../core/drools/DroolsRuleServiceImpl.java | 58 - .../core/exception/FusionExceptionResolver.java | 50 - .../core/exception/SessionExpiredException.java | 35 - .../exception/UrlAccessRestrictedException.java | 35 - .../core/exception/support/FusionException.java | 24 - .../exception/support/FusionRuntimeException.java | 35 - .../core/interceptor/ResourceInterceptor.java | 170 --- .../interceptor/SessionTimeoutInterceptor.java | 103 -- .../core/interfaces/SecurityInterface.java | 24 - .../core/listener/ApplicationContextListener.java | 49 - .../listener/CollaborateListBindingListener.java | 61 - .../core/listener/UserSessionListener.java | 62 - .../portalsdk/core/lm/FusionLicenseManager.java | 60 - .../core/lm/FusionLicenseManagerUtils.java | 74 -- .../portalsdk/core/lm/LicenseableClass.java | 38 - .../portalsdk/core/logging/aspect/AuditLog.java | 32 - .../core/logging/aspect/EELFLoggerAdvice.java | 234 ---- .../core/logging/aspect/EELFLoggerAspect.java | 88 -- .../portalsdk/core/logging/aspect/MetricsLog.java | 32 - .../core/logging/format/AlarmSeverityEnum.java | 28 - .../core/logging/format/AppMessagesEnum.java | 249 ---- .../logging/format/ApplicationCodes.properties | 221 ---- .../core/logging/format/AuditLogFormatter.java | 106 -- .../core/logging/format/ErrorCodesEnum.java | 89 -- .../core/logging/format/ErrorSeverityEnum.java | 27 - .../core/logging/format/ErrorTypeEnum.java | 29 - .../core/logging/logic/EELFLoggerDelegate.java | 484 -------- .../openecomp/portalsdk/core/menu/MenuBuilder.java | 163 --- .../portalsdk/core/menu/MenuProperties.java | 114 -- .../core/objectcache/AbstractCacheManager.java | 60 - .../core/objectcache/jcs/JCSCacheEventHandler.java | 60 - .../core/objectcache/jcs/JCSCacheManager.java | 186 --- .../objectcache/support/FusionCacheManager.java | 36 - .../core/onboarding/client/AppContextManager.java | 45 - .../core/onboarding/session/TestClass.java | 24 - .../portalsdk/core/onboarding/sso/TestClass.java | 24 - .../portalsdk/core/onboarding/ueb/Consumer.java | 155 --- .../core/onboarding/ueb/FunctionalMenu.java | 61 - .../portalsdk/core/onboarding/ueb/Helper.java | 64 - .../portalsdk/core/onboarding/ueb/Publisher.java | 125 -- .../core/onboarding/ueb/PublisherList.java | 77 -- .../core/onboarding/ueb/TopicManager.java | 135 --- .../core/onboarding/ueb/UebException.java | 65 -- .../portalsdk/core/onboarding/ueb/UebManager.java | 358 ------ .../portalsdk/core/onboarding/ueb/UebMsg.java | 119 -- .../portalsdk/core/onboarding/ueb/UebMsgTypes.java | 28 - .../onboarding/ueb/WaitingRequestersQueueList.java | 73 -- .../core/restful/client/HttpStatusAndResponse.java | 42 - .../core/restful/client/PortalRestClientBase.java | 171 --- .../restful/client/SharedContextRestClient.java | 351 ------ .../portalsdk/core/scheduler/CoreRegister.java | 95 -- .../portalsdk/core/scheduler/CronRegistry.java | 125 -- .../portalsdk/core/scheduler/Registerable.java | 30 - .../core/service/AccessConfiguration.java | 126 -- .../portalsdk/core/service/AppService.java | 61 - .../portalsdk/core/service/AppServiceImpl.java | 106 -- .../portalsdk/core/service/AuditService.java | 37 - .../portalsdk/core/service/AuditServiceImpl.java | 50 - .../portalsdk/core/service/BroadcastService.java | 36 - .../core/service/BroadcastServiceImpl.java | 250 ---- .../core/service/CentralAccessCondition.java | 30 - .../portalsdk/core/service/DataAccessService.java | 80 -- .../core/service/DataAccessServiceImpl.java | 594 ---------- .../portalsdk/core/service/ElementLinkService.java | 290 ----- .../portalsdk/core/service/ElementMapService.java | 1029 ---------------- .../portalsdk/core/service/FnMenuService.java | 54 - .../portalsdk/core/service/FnMenuServiceImpl.java | 125 -- .../core/service/FunctionalMenuListService.java | 13 - .../FunctionalMenuListServiceCentralizedImpl.java | 42 - .../service/FunctionalMenuListServiceImpl.java | 33 - .../portalsdk/core/service/LdapService.java | 31 - .../portalsdk/core/service/LdapServiceImpl.java | 267 ----- .../core/service/LocalAccessCondition.java | 19 - .../portalsdk/core/service/LoginService.java | 54 - .../core/service/LoginServiceCentralizedImpl.java | 199 ---- .../portalsdk/core/service/LoginServiceImpl.java | 200 ---- .../portalsdk/core/service/PostDroolsService.java | 34 - .../core/service/PostDroolsServiceImpl.java | 186 --- .../portalsdk/core/service/PostSearchService.java | 37 - .../core/service/PostSearchServiceImpl.java | 207 ---- .../portalsdk/core/service/ProfileService.java | 60 - .../service/ProfileServiceCentralizedImpl.java | 68 -- .../portalsdk/core/service/ProfileServiceImpl.java | 71 -- .../core/service/RestApiRequestBuilder.java | 140 --- .../portalsdk/core/service/RoleService.java | 129 -- .../core/service/RoleServiceCentralizedAccess.java | 183 --- .../portalsdk/core/service/RoleServiceImpl.java | 169 --- .../core/service/RoleServiceNonSpringImpl.java | 122 -- .../portalsdk/core/service/UrlAccessImpl.java | 44 - .../portalsdk/core/service/UrlAccessService.java | 15 - .../portalsdk/core/service/UserProfileService.java | 33 - .../core/service/UserProfileServiceImpl.java | 114 -- .../portalsdk/core/service/UserService.java | 25 - .../core/service/UserServiceCentalizedImpl.java | 101 -- .../portalsdk/core/service/UserServiceImpl.java | 23 - .../core/service/WebServiceCallService.java | 26 - .../core/service/WebServiceCallServiceImpl.java | 189 --- .../core/service/support/FusionService.java | 27 - .../core/service/support/ServiceLocator.java | 27 - .../core/service/support/ServiceLocatorImpl.java | 105 -- .../portalsdk/core/util/CacheManager.java | 43 - .../portalsdk/core/util/EncDecUtilTest.java | 112 -- .../openecomp/portalsdk/core/util/JSONUtil.java | 56 - .../portalsdk/core/util/SystemProperties.java | 333 ------ .../openecomp/portalsdk/core/util/UsageUtils.java | 92 -- .../openecomp/portalsdk/core/util/YamlUtils.java | 72 -- .../core/web/socket/PeerBroadcastSocket.java | 104 -- .../portalsdk/core/web/socket/WebRTCSocket.java | 143 --- .../portalsdk/core/web/support/AppUtils.java | 213 ---- .../core/web/support/ControllerProperties.java | 41 - .../core/web/support/FeedbackMessage.java | 80 -- .../portalsdk/core/web/support/JsonMessage.java | 118 -- .../portalsdk/core/web/support/MessagesList.java | 92 -- .../portalsdk/core/web/support/UserUtils.java | 395 ------- 341 files changed, 24317 insertions(+), 21329 deletions(-) create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/FusionObject.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuCountry.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuState.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LuTimeZone.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Menu.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/MenuData.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Profile.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Role.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/RoleFunction.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessible.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UrlsAccessibleKey.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/User.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserAppId.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/sessionmgt/TimeoutVO.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Attribute.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/CollaborateList.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Container.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Domain.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/DomainVo.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Element.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/ElementDetails.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/FusionCommand.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Layout.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/NameValueId.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Position.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/support/Size.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/drools/DroolsRuleService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/drools/DroolsRuleServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/FusionExceptionResolver.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/SessionExpiredException.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/UrlAccessRestrictedException.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/support/FusionException.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/exception/support/FusionRuntimeException.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/SessionTimeoutInterceptor.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interfaces/SecurityInterface.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/listener/ApplicationContextListener.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/listener/CollaborateListBindingListener.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/listener/UserSessionListener.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/lm/FusionLicenseManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/lm/FusionLicenseManagerUtils.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/lm/LicenseableClass.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/AuditLog.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAspect.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/MetricsLog.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/format/AlarmSeverityEnum.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/format/AppMessagesEnum.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/format/ApplicationCodes.properties create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/format/AuditLogFormatter.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/format/ErrorCodesEnum.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/format/ErrorSeverityEnum.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/format/ErrorTypeEnum.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegate.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/menu/MenuBuilder.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/menu/MenuProperties.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/AbstractCacheManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/jcs/JCSCacheEventHandler.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/jcs/JCSCacheManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/objectcache/support/FusionCacheManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/client/AppContextManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/session/TestClass.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/sso/TestClass.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/Consumer.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/FunctionalMenu.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/Helper.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/Publisher.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/PublisherList.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/TopicManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/UebException.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/UebManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/UebMsg.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/UebMsgTypes.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/onboarding/ueb/WaitingRequestersQueueList.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/HttpStatusAndResponse.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/PortalRestClientBase.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/SharedContextRestClient.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/scheduler/CoreRegister.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/scheduler/CronRegistry.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/scheduler/Registerable.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AccessConfiguration.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AppService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AppServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AuditService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/AuditServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/BroadcastService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/BroadcastServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/CentralAccessCondition.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementLinkService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/FnMenuService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/FnMenuServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/FunctionalMenuListService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/FunctionalMenuListServiceCentralizedImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/FunctionalMenuListServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LdapService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LdapServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LocalAccessCondition.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceCentralizedImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/LoginServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostDroolsService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostDroolsServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostSearchService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/PostSearchServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ProfileService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ProfileServiceCentralizedImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ProfileServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RoleService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RoleServiceCentralizedAccess.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RoleServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserProfileService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserProfileServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceCentalizedImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/support/FusionService.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/support/ServiceLocator.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/support/ServiceLocatorImpl.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/CacheManager.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/EncDecUtilTest.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/JSONUtil.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/UsageUtils.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/YamlUtils.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/socket/PeerBroadcastSocket.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/socket/WebRTCSocket.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/AppUtils.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/ControllerProperties.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/FeedbackMessage.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/JsonMessage.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/MessagesList.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/support/UserUtils.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/FusionObject.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/auth/LoginStrategy.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/command/LoginBean.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/command/PostDroolsBean.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/command/PostSearchBean.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/command/UserRowBean.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/command/support/SearchBase.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/command/support/SearchResult.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/conf/AppConfig.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/conf/AppInitializer.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/conf/Configurable.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/conf/HibernateConfiguration.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/conf/HibernateMappingLocatable.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/controller/FusionBaseController.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/controller/RestrictedBaseController.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/controller/RestrictedRESTfulBaseController.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/controller/UnRestrictedBaseController.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/dao/AbstractDao.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/dao/ProfileDao.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/dao/ProfileDaoImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/dao/hibernate/ModelOperationsCommon.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/dao/support/FusionDao.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/App.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/AuditLog.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/BroadcastMessage.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/DomainVo.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/FnMenu.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/FusionVo.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LoginBean.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Lookup.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuCountry.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuState.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuTimeZone.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Menu.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/MenuData.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Profile.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Role.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/RoleFunction.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/UrlsAccessible.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/UrlsAccessibleKey.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/User.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/UserApp.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/UserAppId.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/sessionmgt/TimeoutVO.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Attribute.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/CollaborateList.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Container.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Domain.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/DomainVo.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Element.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/ElementDetails.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/FusionCommand.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Layout.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/NameValueId.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Position.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Size.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/drools/DroolsRuleService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/drools/DroolsRuleServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/exception/FusionExceptionResolver.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/exception/SessionExpiredException.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/exception/UrlAccessRestrictedException.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/exception/support/FusionException.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/exception/support/FusionRuntimeException.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/interceptor/ResourceInterceptor.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/interceptor/SessionTimeoutInterceptor.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/interfaces/SecurityInterface.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/listener/ApplicationContextListener.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/listener/CollaborateListBindingListener.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/listener/UserSessionListener.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/lm/FusionLicenseManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/lm/FusionLicenseManagerUtils.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/lm/LicenseableClass.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/aspect/AuditLog.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/aspect/EELFLoggerAdvice.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/aspect/EELFLoggerAspect.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/aspect/MetricsLog.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/format/AlarmSeverityEnum.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/format/AppMessagesEnum.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/format/ApplicationCodes.properties delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/format/AuditLogFormatter.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/format/ErrorCodesEnum.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/format/ErrorSeverityEnum.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/format/ErrorTypeEnum.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/logging/logic/EELFLoggerDelegate.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/menu/MenuBuilder.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/menu/MenuProperties.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/objectcache/AbstractCacheManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/objectcache/jcs/JCSCacheEventHandler.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/objectcache/jcs/JCSCacheManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/objectcache/support/FusionCacheManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/client/AppContextManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/session/TestClass.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/sso/TestClass.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/Consumer.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/FunctionalMenu.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/Helper.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/Publisher.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/PublisherList.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/TopicManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/UebException.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/UebManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/UebMsg.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/UebMsgTypes.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/onboarding/ueb/WaitingRequestersQueueList.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/restful/client/HttpStatusAndResponse.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/restful/client/PortalRestClientBase.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/restful/client/SharedContextRestClient.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/scheduler/CoreRegister.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/scheduler/CronRegistry.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/scheduler/Registerable.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/AccessConfiguration.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/AppService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/AppServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/AuditService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/AuditServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/BroadcastService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/BroadcastServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/CentralAccessCondition.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/DataAccessService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/DataAccessServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/ElementLinkService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/ElementMapService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FunctionalMenuListService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FunctionalMenuListServiceCentralizedImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FunctionalMenuListServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/LdapService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/LdapServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/LocalAccessCondition.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/LoginService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/LoginServiceCentralizedImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/LoginServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/PostDroolsService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/PostDroolsServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/PostSearchService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/PostSearchServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/ProfileService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/ProfileServiceCentralizedImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/ProfileServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RoleService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RoleServiceCentralizedAccess.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RoleServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RoleServiceNonSpringImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/UrlAccessImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/UrlAccessService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/UserProfileService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/UserProfileServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/UserService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/UserServiceCentalizedImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/UserServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/WebServiceCallService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/WebServiceCallServiceImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/support/FusionService.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/support/ServiceLocator.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/support/ServiceLocatorImpl.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/util/CacheManager.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/util/EncDecUtilTest.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/util/JSONUtil.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/util/SystemProperties.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/util/UsageUtils.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/util/YamlUtils.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/socket/PeerBroadcastSocket.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/socket/WebRTCSocket.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/support/AppUtils.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/support/ControllerProperties.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/support/FeedbackMessage.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/support/JsonMessage.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/support/MessagesList.java delete mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/web/support/UserUtils.java (limited to 'ecomp-sdk/epsdk-core/src/main/java/org') diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/FusionObject.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/FusionObject.java new file mode 100644 index 00000000..d44fb7e6 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/FusionObject.java @@ -0,0 +1,129 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core; + +/** + *

+ * Title: FusionObject + *

+ * + *

+ * Description: This interface is implemented by all top-level support classes + * of each package in FUSION. This allows all top-level support classes to have + * some commonality for easier maintenance. + *

+ * + *

+ * Copyright: Copyright (c) 2007 + *

+ * + * @version 1.1 + */ +public interface FusionObject { + + public class Parameters { + // HashMap parameters passed to the Service and Dao tiers + public static final String PARAM_USERID = "userId"; + public static final String PARAM_HTTP_REQUEST = "request"; + public static final String PARAM_FILTERS = "filters"; + public static final String PARAM_CLIENT_DEVICE = "client_device"; + // Request parameters passed in the Web tier + public static final String REQUEST_PARAM_DISPLAY_SUCCESS_MESSAGE = "display_success_message"; + } + + /** + *

+ * Title: FusionObject.Utilities + *

+ * + *

+ * Description: Inner class that has some utility functions available for + * any class that implements it. + *

+ * + *

+ * Copyright: Copyright (c) 2007 + *

+ * + * @version 1.1 + */ + public class Utilities { + /** + * nvl - replaces a string value with an empty string if null. + * + * @param s + * String - the string value that needs to be checked + * @return String - returns the original string value if not null. + * Otherwise an empty string ("") is returned. + */ + public static String nvl(String s) { + return (s == null) ? "" : s; + } + + /** + * nvl - replaces a string value with a default value if null. + * + * @param s + * String - the string value that needs to be checked + * @param sDefault + * String - the default value + * @return String - returns the original string value if not null. + * Otherwise the default value is returned. + */ + public static String nvl(String s, String sDefault) { + return nvl(s).equals("") ? sDefault : s; + } + + /** + * Tests the specified string for nullity. + * + * @param a + * String to test for nullity. + * @return True if the specified string is null, empty or the 4-character + * sequence "null" (ignoring case); otherwise false. + */ + public static boolean isNull(String a) { + if ((a == null) || (a.length() == 0) || a.equalsIgnoreCase("null")) + return true; + else + return false; + } + + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java new file mode 100644 index 00000000..7fe4f632 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java @@ -0,0 +1,158 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.auth; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.onap.portalsdk.core.command.LoginBean; +import org.onap.portalsdk.core.domain.RoleFunction; +import org.onap.portalsdk.core.menu.MenuProperties; +import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; +import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; +import org.onap.portalsdk.core.service.LoginService; +import org.onap.portalsdk.core.service.RoleService; +import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.web.support.AppUtils; +import org.onap.portalsdk.core.web.support.UserUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.util.WebUtils; + +public abstract class LoginStrategy { + + public static final String DEFAULT_SUCCESS_VIEW = "welcome"; + public static final String DEFAULT_FAILURE_VIEW = "login"; + private static final String JSESSIONID = "JSESSIONID"; + + public static final String EP_SERVICE = "EPService"; + public static final String USER_ID = "UserId"; + public static final String ERROR_MESSAGE_KEY = "error"; + + @Autowired + private LoginService loginService; + + @Autowired + RoleService roleService; + + public abstract ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception; + + public abstract String getUserId(HttpServletRequest request) throws PortalAPIException; + + public ModelAndView doExternalLogin(HttpServletRequest request, HttpServletResponse response) throws Exception { + + invalidateExistingSession(request); + + Map model = new HashMap(); + LoginBean commandBean = new LoginBean(); + String loginId = request.getParameter("loginId"); + String password = request.getParameter("password"); + commandBean.setLoginId(loginId); + commandBean.setLoginPwd(password); + HashMap additionalParamsMap = new HashMap(); + + // Get the client device type and pass it into LoginService for audit + // logging. + /** + * ClientDeviceType clientDevice = (ClientDeviceType)request.getAttribut + * (SystemProperties.getProperty(SystemProperties.CLIENT_DEVICE_ATTRIBUTE_NAME)); + * additionalParamsMap.put(Parameters.PARAM_CLIENT_DEVICE, + * clientDevice); + **/ + commandBean = loginService.findUser(commandBean, + (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), additionalParamsMap); + List roleFunctionList= roleService.getRoleFunctions(loginId); + + + + if (commandBean.getUser() == null) { + String loginErrorMessage = (commandBean.getLoginErrorMessage() != null) ? commandBean.getLoginErrorMessage() + : "login.error.external.invalid"; + model.put("error", loginErrorMessage); + + String[] errorCodes = new String[1]; + errorCodes[0] = loginErrorMessage; + + return new ModelAndView("login_external", "model", model); + + } else { + // store the currently logged in user's information in the session + UserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(), + commandBean.getBusinessDirectMenu(), + SystemProperties.getProperty(SystemProperties.LOGIN_METHOD_BACKDOOR), roleFunctionList); + initateSessionMgtHandler(request); + + // user has been authenticated, now take them to the welcome page + // return new ModelAndView("redirect:/profile_search"); + return new ModelAndView("redirect:welcome.htm"); + + } + } + + protected void invalidateExistingSession(HttpServletRequest request){ + request.getSession().invalidate(); + } + + protected String getJessionId(HttpServletRequest request) { + Cookie ep = WebUtils.getCookie(request, JSESSIONID); + if (ep == null) { + return request.getSession().getId(); + } + return ep.getValue(); + + } + + protected void initateSessionMgtHandler(HttpServletRequest request) { + String jSessionId = getJessionId(request); + PortalTimeoutHandler.sessionCreated(jSessionId, jSessionId, AppUtils.getSession(request)); + } + + public LoginService getLoginService() { + return loginService; + } + + public void setLoginService(LoginService loginService) { + this.loginService = loginService; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java new file mode 100644 index 00000000..0f156bce --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java @@ -0,0 +1,211 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.command; + +import java.util.Set; + +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.support.FusionCommand; + +public class LoginBean extends FusionCommand { + + private String loginId; + private String loginPwd; + private String hrid; + private String userid; + private String siteAccess; + private String loginErrorMessage; + + private User user; + @SuppressWarnings("rawtypes") + private Set menu; + @SuppressWarnings("rawtypes") + private Set businessDirectMenu; + + /** + * getLoginId + * + * @return String + */ + public String getLoginId() { + return loginId; + } + + /** + * getLoginPwd + * + * @return String + */ + public String getLoginPwd() { + return loginPwd; + } + + /** + * getMenu + * + * @return Set + */ + @SuppressWarnings("rawtypes") + public Set getMenu() { + return menu; + } + + /** + * getUser + * + * @return User + */ + public User getUser() { + return user; + } + + /** + * getHrid + * + * @return String + */ + public String getHrid() { + return hrid; + } + + /** + * getSiteAccess + * + * @return String + */ + public String getSiteAccess() { + return siteAccess; + } + + /** + * getBusinessDirectMenu + * + * @return Set + */ + @SuppressWarnings("rawtypes") + public Set getBusinessDirectMenu() { + return businessDirectMenu; + } + + /** + * getLoginErrorMessage + * + * @return String + */ + public String getLoginErrorMessage() { + return loginErrorMessage; + } + + /** + * setLoginId + * + * @param loginId String + */ + public void setLoginId(String loginId) { + this.loginId = loginId; + } + + /** + * setLoginPwd + * + * @param loginPwd String + */ + public void setLoginPwd(String loginPwd) { + this.loginPwd = loginPwd; + } + + @SuppressWarnings("rawtypes") + public void setMenu(Set menu) { + this.menu = menu; + } + + /** + * setUser + * + * @param user User + */ + public void setUser(User user) { + this.user = user; + } + + /** + * setHrid + * + * @param hrid String + */ + public void setHrid(String hrid) { + this.hrid = hrid; + } + + /** + * setSiteAccess + * + * @param siteAccess String + */ + public void setSiteAccess(String siteAccess) { + this.siteAccess = siteAccess; + } + + /** + * setBusinessDirectMenu + * + * @param businessDirectMenu Set + */ + @SuppressWarnings("rawtypes") + public void setBusinessDirectMenu(Set businessDirectMenu) { + this.businessDirectMenu = businessDirectMenu; + } + + /** + * setLoginErrorMessage + * + * @param loginErrorMessage String + */ + public void setLoginErrorMessage(String loginErrorMessage) { + this.loginErrorMessage = loginErrorMessage; + } + + public String getUserid() { + return userid; + } + + public void setUserid(String userid) { + this.userid = userid; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java new file mode 100644 index 00000000..89052495 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java @@ -0,0 +1,69 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.command; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +@JsonSerialize +public class PostDroolsBean { + + private String droolsFile; + private String className; + private String selectedRules; + + public String getDroolsFile() { + return droolsFile; + } + public void setDroolsFile(String droolsFile) { + this.droolsFile = droolsFile; + } + public String getSelectedRules() { + return selectedRules; + } + public void setSelectedRules(String selectedRules) { + this.selectedRules = selectedRules; + } + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java new file mode 100644 index 00000000..3b32364e --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java @@ -0,0 +1,393 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.command; + +import java.util.List; + +import org.onap.portalsdk.core.command.support.SearchBase; +import org.onap.portalsdk.core.domain.User; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +@JsonSerialize +public class PostSearchBean extends SearchBase { + + private User user = null; + private User userOrig = null; + private String[] selected; + private String[] postHrid; + private String[] postOrgUserId; + private String[] postFirstName; + private String[] postLastName; + private String[] postOrgCode; + private String[] postPhone; + private String[] postEmail; + private String[] postAddress1; + private String[] postAddress2; + private String[] postCity; + private String[] postState; + private String[] postZipCode; + private String[] postLocationClli; + private String[] postBusinessCountryCode; + private String[] postBusinessCountryName; + private String[] postDepartment; + private String[] postDepartmentName; + private String[] postBusinessUnit; + private String[] postBusinessUnitName; + private String[] postJobTitle; + private String[] postOrgManagerUserId; + private String[] postCommandChain; + private String[] postCompanyCode; + private String[] postCompany; + private String[] postCostCenter; + private String[] postSiloStatus; + private String[] postFinancialLocCode; + + + @SuppressWarnings("rawtypes") + public PostSearchBean() { + this(null); + } // PostSearchBean + + @SuppressWarnings("rawtypes") + public PostSearchBean(List items) { + super(items); + + user = new User(); + userOrig = new User(); + + setSortBy1(""); + setSortBy1Orig(""); + + //setSortByList(...); + } // PostSearchBean + + + public String getFirstName() { return user.getFirstName(); } + public String getLastName() { return user.getLastName(); } + public String getHrid() { return user.getHrid(); } + public String getOrgUserId() { return user.getOrgUserId(); } + public String getOrgCode() { return user.getOrgCode(); } + public String getEmail() { return user.getEmail(); } + public String getOrgManagerUserId() { return user.getOrgManagerUserId(); } + + public String getFirstNameOrig() { return user.getFirstName(); } + public String getLastNameOrig() { return user.getLastName(); } + public String getHridOrig() { return user.getHrid(); } + public String getOrgUserIdOrig() { return user.getOrgUserId(); } + public String getOrgCodeOrig() { return user.getOrgCode(); } + public String getEmailOrig() { return user.getEmail(); } + public String getOrgManagerUserIdOrig() { return user.getOrgManagerUserId(); } + + + public User getUser() { return user; } + + public String[] getPostEmail() { + return postEmail; + } + + public String[] getPostFirstName() { + return postFirstName; + } + + public String[] getPostHrid() { + return postHrid; + } + + public String[] getPostLastName() { + return postLastName; + } + + public String[] getPostOrgCode() { + return postOrgCode; + } + + public String[] getPostPhone() { + return postPhone; + } + + public String[] getPostOrgUserId() { + return postOrgUserId; + } + + public String[] getSelected() { + return selected; + } + + public String[] getPostAddress1() { + return postAddress1; + } + + public String[] getPostBusinessCountryCode() { + return postBusinessCountryCode; + } + + public String[] getPostCity() { + return postCity; + } + + public String[] getPostCommandChain() { + return postCommandChain; + } + + public String[] getPostCompany() { + return postCompany; + } + + public String[] getPostCompanyCode() { + return postCompanyCode; + } + + public String[] getPostDepartment() { + return postDepartment; + } + + public String[] getPostDepartmentName() { + return postDepartmentName; + } + + public String[] getPostBusinessCountryName() { + return postBusinessCountryName; + } + + public String[] getPostJobTitle() { + return postJobTitle; + } + + public String[] getPostLocationClli() { + return postLocationClli; + } + + public String[] getPostOrgManagerUserId() { + return postOrgManagerUserId; + } + + public String[] getPostState() { + return postState; + } + + public String[] getPostZipCode() { + return postZipCode; + } + + public void setFirstName(String value) { user.setFirstName(value); } + public void setLastName(String value) { user.setLastName(value); } + public void setHrid(String value) { user.setHrid(value); } + public void setOrgUserId(String value) { user.setOrgUserId(value); } + public void setOrgCode(String value) { user.setOrgCode(value); } + public void setEmail(String value) { user.setEmail(value); } + public void setOrgManagerUserId(String value) { user.setOrgManagerUserId(value); } + + public void setFirstNameOrig(String value) { userOrig.setFirstName(value); } + public void setLastNameOrig(String value) { userOrig.setLastName(value); } + public void setHridOrig(String value) { userOrig.setHrid(value); } + public void setOrgUserIdOrig(String value) { userOrig.setOrgUserId(value); } + public void setOrgCodeOrig(String value) { userOrig.setOrgCode(value); } + public void setEmailOrig(String value) { userOrig.setEmail(value); } + public void setOrgManagerUserIdOrig(String value) { userOrig.setOrgManagerUserId(value); } + + public void setUser(User value) { this.user = value; } + + public void setPostEmail(String[] postEmail) { + this.postEmail = postEmail; + } + + public void setPostFirstName(String[] postFirstName) { + this.postFirstName = postFirstName; + } + + public void setPostHrid(String[] postHrid) { + this.postHrid = postHrid; + } + + public void setPostLastName(String[] postLastName) { + this.postLastName = postLastName; + } + + public void setPostOrgCode(String[] postOrgCode) { + this.postOrgCode = postOrgCode; + } + + public void setPostPhone(String[] postPhone) { + this.postPhone = postPhone; + } + + public void setPostOrgUserId(String[] postOrgUserId) { + this.postOrgUserId = postOrgUserId; + } + + public void setSelected(String[] selected) { + this.selected = selected; + } + + public void setPostAddress1(String[] postAddress1) { + this.postAddress1 = postAddress1; + } + + public void setPostBusinessCountryCode(String[] postBusinessCountryCode) { + this.postBusinessCountryCode = postBusinessCountryCode; + } + + public void setPostCity(String[] postCity) { + this.postCity = postCity; + } + + public void setPostCommandChain(String[] postCommandChain) { + this.postCommandChain = postCommandChain; + } + + public void setPostCompany(String[] postCompany) { + this.postCompany = postCompany; + } + + public void setPostCompanyCode(String[] postCompanyCode) { + this.postCompanyCode = postCompanyCode; + } + + public void setPostDepartment(String[] postDepartment) { + this.postDepartment = postDepartment; + } + + public void setPostDepartmentName(String[] postDepartmentName) { + this.postDepartmentName = postDepartmentName; + } + + public void setPostBusinessCountryName(String[] postBusinessCountryName) { + this.postBusinessCountryName = postBusinessCountryName; + } + + public void setPostJobTitle(String[] postJobTitle) { + this.postJobTitle = postJobTitle; + } + + public void setPostLocationClli(String[] postLocationClli) { + this.postLocationClli = postLocationClli; + } + + public void setPostOrgManagerUserId(String[] postOrgManagerUserId) { + this.postOrgManagerUserId = postOrgManagerUserId; + } + + public void setPostState(String[] postState) { + this.postState = postState; + } + + public void setPostZipCode(String[] postZipCode) { + this.postZipCode = postZipCode; + } + + public String[] getPostAddress2() { + return postAddress2; + } + + public void setPostAddress2(String[] postAddress2) { + this.postAddress2 = postAddress2; + } + + public User getUserOrig() { + return userOrig; + } + + public void setUserOrig(User userOrig) { + this.userOrig = userOrig; + } + + public String[] getPostBusinessUnit() { + return postBusinessUnit; + } + + public void setPostBusinessUnit(String[] postBusinessUnit) { + this.postBusinessUnit = postBusinessUnit; + } + + public String[] getPostBusinessUnitName() { + return postBusinessUnitName; + } + + public void setPostBusinessUnitName(String[] postBusinessUnitName) { + this.postBusinessUnitName = postBusinessUnitName; + } + + public String[] getPostCostCenter() { + return postCostCenter; + } + + public void setPostCostCenter(String[] postCostCenter) { + this.postCostCenter = postCostCenter; + } + + public String[] getPostSiloStatus() { + return postSiloStatus; + } + + public void setPostSiloStatus(String[] postSiloStatus) { + this.postSiloStatus = postSiloStatus; + } + + public String[] getPostFinancialLocCode() { + return postFinancialLocCode; + } + + public void setPostFinancialLocCode(String[] postFinancialLocCode) { + this.postFinancialLocCode = postFinancialLocCode; + } + + public void resetSearch() { + super.resetSearch(); + setUser(new User()); + } // resetSearch + + + public boolean isCriteriaUpdated() { + if(user==null&&userOrig==null) + return false; + else if(user==null||userOrig==null) + return true; + else + return (! ( + Utilities.nvl(user.getFirstName()).equals(Utilities.nvl(userOrig.getFirstName()))&& + Utilities.nvl(user.getLastName()).equals(Utilities.nvl(userOrig.getLastName()))&& + //Utilities.nvl(user.getHrid()).equals(Utilities.nvl(userOrig.getHrid()))&& + Utilities.nvl(user.getOrgUserId()).equals(Utilities.nvl(userOrig.getOrgUserId()))&& + Utilities.nvl(user.getOrgCode()).equals(Utilities.nvl(userOrig.getOrgCode()))&& + Utilities.nvl(user.getEmail()).equals(Utilities.nvl(userOrig.getEmail()))&& + Utilities.nvl(user.getOrgManagerUserId()).equals(Utilities.nvl(userOrig.getOrgManagerUserId()))&& + true)); + } // isCriteriaUpdated + +} // PostSearchBean diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java new file mode 100644 index 00000000..49854e6b --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java @@ -0,0 +1,103 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.command; + +import org.onap.portalsdk.core.domain.User; + +public class UserRowBean extends User { + + /** + * + */ + private static final long serialVersionUID = -2724597119083972190L; + private String sessionId; + private String lastAccess; + private String remaining; + private String loginTime; + private String LastLoginTime; + + + public String getLastAccess(){ + return this.lastAccess; + } + + + public void setLastAccess(String lastAccess){ + this.lastAccess = lastAccess; + } + + + public String getRemaining(){ + return this.remaining; + } + + + public void setRemaining(String remaining){ + this.remaining = remaining; + } + + + public String getSessionId() { + return sessionId; + } + + + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + + public String getLoginTime() { + return loginTime; + } + + + public void setLoginTime(String loginTime) { + this.loginTime = loginTime; + } + + + public String getLastLoginTime() { + return LastLoginTime; + } + + + public void setLastLoginTime(String lastLoginTime) { + LastLoginTime = lastLoginTime; + } +} \ No newline at end of file diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java new file mode 100644 index 00000000..c053d95b --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java @@ -0,0 +1,288 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.command.support; + +import java.util.*; + +import org.onap.portalsdk.core.domain.support.FusionCommand; + +public abstract class SearchBase extends FusionCommand { + + public static String SORT_BY_MODIFIER_DESC = "D"; + public static String SORT_BY_MODIFIER_ASC = "A"; + public static String SORT_BY_MODIFIER_DESC_IMAGE_NAME = "sort_desc.gif"; + public static String SORT_BY_MODIFIER_ASC_IMAGE_NAME = "sort_asc.gif"; + + + private String sortBy1 = null; + private String sortBy2 = null; + private String sortBy3 = null; + + private String sortBy1Orig = null; + private String sortBy2Orig = null; + private String sortBy3Orig = null; + + private String sortByModifier1 = null; + private String sortByModifier2 = null; + private String sortByModifier3 = null; + + private String sortByModifier1Orig = null; + private String sortByModifier2Orig = null; + private String sortByModifier3Orig = null; + + private String accessType = "WRITE"; //null; + + private String submitAction = ""; + private String masterId = ""; + private String detailId = ""; + + private String showResult = "Y"; + + private SearchResult searchResult = null; + private boolean sortingUpdated; + + @SuppressWarnings("rawtypes") + public SearchBase(List items) { + searchResult = (items == null) ? (new SearchResult()) : (new SearchResult(items)); + } // SearchBase + + + public String getSortBy1() { + return sortBy1; + } + + public String getSortBy2() { + return sortBy2; + } + + public String getSortBy3() { + return sortBy3; + } + + public String getSortBy1Orig() { + return sortBy1; + } + + public String getSortBy2Orig() { + return sortBy2; + } + + public String getSortBy3Orig() { + return sortBy3; + } + + public String getAccessType() { + return accessType; + } + + public String getSubmitAction() { + return submitAction; + } + + public String getMasterId() { + return masterId; + } + + public String getDetailId() { + return detailId; + } + + public String getShowResult() { + return showResult; + } + + //public ArrayList getSortByList() { return sortByList; } + + public SearchResult getSearchResult() { + return searchResult; + } + + public String getSortByModifier1() { + return sortByModifier1; + } + + public String getSortByModifier1Orig() { + return sortByModifier1; + } + + public String getSortByModifier2() { + return sortByModifier2; + } + + public String getSortByModifier2Orig() { + return sortByModifier2; + } + + public String getSortByModifier3() { + return sortByModifier3; + } + + public String getSortByModifier3Orig() { + return sortByModifier3; + } + + public int getPageNo() { + return (isCriteriaUpdated() || isSortingUpdated()) ? 0 : getSearchResult().getPageNo(); + } + + public int getPageSize() { + return getSearchResult().getPageSize(); + } + + public int getDataSize() { + return getSearchResult().getDataSize(); + } + + public int getNewDataSize() { + return isCriteriaUpdated() ? -1 : getDataSize(); + } + + + public void setSortBy1(String sortBy1) { + this.sortBy1 = sortBy1; + } + + public void setSortBy2(String sortBy2) { + this.sortBy2 = sortBy2; + } + + public void setSortBy3(String sortBy3) { + this.sortBy3 = sortBy3; + } + + public void setSortBy1Orig(String sortBy1Orig) { + this.sortBy1Orig = sortBy1Orig; + } + + public void setSortBy2Orig(String sortBy2Orig) { + this.sortBy2Orig = sortBy2Orig; + } + + public void setSortBy3Orig(String sortBy3Orig) { + this.sortBy3Orig = sortBy3Orig; + } + + public void setAccessType(String accessType) { + this.accessType = accessType; + } + + public void setSubmitAction(String submitAction) { + this.submitAction = submitAction; + } + + public void setMasterId(String masterId) { + this.masterId = masterId; + } + + public void setDetailId(String detailId) { + this.detailId = detailId; + } + + public void setShowResult(String showResult) { + this.showResult = showResult; + } + + public void setSearchResult(SearchResult searchResult) { + this.searchResult = searchResult; + } + + public void setSortByModifier1(String sortByModifier1) { + this.sortByModifier1 = sortByModifier1; + } + + public void setSortByModifier1Orig(String sortByModifier1Orig) { + this.sortByModifier1Orig = sortByModifier1Orig; + } + + public void setSortByModifier2(String sortByModifier2) { + this.sortByModifier2 = sortByModifier2; + } + + public void setSortByModifier2Orig(String sortByModifier2Orig) { + this.sortByModifier2Orig = sortByModifier2Orig; + } + + public void setSortByModifier3(String sortByModifier3) { + this.sortByModifier3 = sortByModifier3; + } + + public void setSortByModifier3Orig(String sortByModifier3Orig) { + this.sortByModifier3Orig = sortByModifier3Orig; + } + + public void setSortingUpdated(boolean sortingUpdated) { + this.sortingUpdated = sortingUpdated; + } + + public void setPageNo(int pageNo) { + getSearchResult().setPageNo(pageNo); + } + + public void setPageSize(int pageSize) { + getSearchResult().setPageSize(pageSize); + } + + public void setDataSize(int dataSize) { + getSearchResult().setDataSize(dataSize); + } + + + public void resetSearch() { + setSortBy1(null); + setSortBy2(null); + setSortBy3(null); + setSortByModifier1(SearchBase.SORT_BY_MODIFIER_ASC); + setSortByModifier2(SearchBase.SORT_BY_MODIFIER_ASC); + setSortByModifier3(SearchBase.SORT_BY_MODIFIER_ASC); + setPageNo(0); + setDataSize( -1); + } // resetSearch + + + public abstract boolean isCriteriaUpdated(); + + public boolean isSortingUpdated() { + return (!(Utilities.nvl(sortBy1).equals(Utilities.nvl(sortBy1Orig)) && + Utilities.nvl(sortBy2).equals(Utilities.nvl(sortBy2Orig)) && + Utilities.nvl(sortBy3).equals(Utilities.nvl(sortBy3Orig)) && + Utilities.nvl(sortByModifier1).equals(Utilities.nvl(sortByModifier1Orig)) && + Utilities.nvl(sortByModifier2).equals(Utilities.nvl(sortByModifier2Orig)) && + Utilities.nvl(sortByModifier3).equals(Utilities.nvl(sortByModifier3Orig)))); + } // isSortingUpdated + +} // SearchBase diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java new file mode 100644 index 00000000..d1c1f315 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java @@ -0,0 +1,85 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.command.support; + +import java.util.*; + +@SuppressWarnings("rawtypes") +public class SearchResult extends ArrayList implements java.io.Serializable { + /** + * + */ + private static final long serialVersionUID = -451947878984459011L; + private int pageNo = 0; + private int pageSize = 50; + private int dataSize = -1; + + private String accessType = null; + + //private boolean empty = true; // Overrides collections [isEmpty] with searchResult present/not present logic + + + public SearchResult() {} + + @SuppressWarnings("unchecked") + public SearchResult(List items) { + super(items); + } // SearchResult + + /*public SearchResult(boolean empty) { + this(); + this.empty = empty; + } // SearchResult*/ + + + public int getPageNo() { return pageNo; } + public int getPageSize() { return pageSize; } + public int getDataSize() { return dataSize; } + + public int getSize() { return size(); } // for Struts bean property access + //public boolean isEmpty() { return empty; } + + public String getAccessType() { return accessType; } + + public void setPageNo(int pageNo) { this.pageNo=pageNo; } + public void setPageSize(int pageSize) { this.dataSize=pageSize; } + public void setDataSize(int dataSize) { this.dataSize=dataSize; } + + public void setAccessType(String accessType) { this.accessType = accessType; } + +} // SearchResult diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java new file mode 100644 index 00000000..26624359 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java @@ -0,0 +1,382 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.conf; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import org.onap.portalsdk.core.interceptor.ResourceInterceptor; +import org.onap.portalsdk.core.interceptor.SessionTimeoutInterceptor; +import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum; +import org.onap.portalsdk.core.logging.format.AppMessagesEnum; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.menu.MenuBuilder; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.core.service.DataAccessServiceImpl; +import org.onap.portalsdk.core.service.LocalAccessCondition; +import org.onap.portalsdk.core.service.RestApiRequestBuilder; +import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.web.support.AppUtils; +import org.onap.portalsdk.core.web.support.UserUtils; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.web.servlet.ViewResolver; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.view.InternalResourceViewResolver; +import org.springframework.web.servlet.view.JstlView; +import org.springframework.web.servlet.view.UrlBasedViewResolver; +import org.springframework.web.servlet.view.tiles3.TilesConfigurer; +import org.springframework.web.servlet.view.tiles3.TilesView; + +import com.mchange.v2.c3p0.ComboPooledDataSource; + +/** + * Configures Spring features in the ONAP Portal SDK including request + * interceptors and view resolvers. Application should subclass and override + * methods as needed. + */ +public class AppConfig extends WebMvcConfigurerAdapter implements Configurable, ApplicationContextAware { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppConfig.class); + + private final List tileDefinitions = new ArrayList(); + protected ApplicationContext appApplicationContext = null; + + public AppConfig() { + // loads all default fields and marks logging + // has been started for each log file type. + initGlobalLocalContext(); + } + + /** + * Creates and returns a new instance of a secondary (order=2) + * {@link ViewResolver} that finds files by adding prefix "/WEB-INF/jsp/" + * and suffix ".jsp" to the base view name. + * + * @return New instance of {@link ViewResolver}. + */ + @Bean + public ViewResolver viewResolver() { + InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); + viewResolver.setViewClass(JstlView.class); + viewResolver.setPrefix("/WEB-INF/jsp/"); + viewResolver.setSuffix(".jsp"); + viewResolver.setOrder(2); + return viewResolver; + } + + /** + * Loads all the default logging fields into the global MDC context and + * marks each log file type that logging has been started. + */ + private void initGlobalLocalContext() { + logger.init(); + } + + /* + * Any requests from the url pattern /static/**, Spring will look for the + * resources from the /static/ Same as in xml + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + // registry.addResourceHandler("/static/**").addResourceLocations("/static/"); + registry.addResourceHandler("/**").addResourceLocations("/"); + } + + /** + * Creates and returns a new instance of a {@link DataAccessService} class. + * + * @return New instance of {@link DataAccessService}. + */ + @Bean + public DataAccessService dataAccessService() { + return new DataAccessServiceImpl(); + } + + /** + * Creates and returns a new instance of a {@link SystemProperties} class. + * + * @return New instance of {@link SystemProperties}. + */ + @Bean + public SystemProperties systemProperties() { + return new SystemProperties(); + } + + /** + * Creates and returns a new instance of a {@link MenuBuilder} class. + * + * @return New instance of {@link MenuBuilder}. + */ + @Bean + public MenuBuilder menuBuilder() { + return new MenuBuilder(); + } + + /** + * Creates and returns a new instance of a {@link UserUtils} class. + * + * @return New instance of {@link UserUtils}. + */ + @Bean + public UserUtils userUtil() + { + return new UserUtils(); + } + + /** + * Creates and returns a new instance of an {@link AppUtils} class. + * + * @return New instance of {@link AppUtils}. + */ + @Bean + public AppUtils appUtils() { + return new AppUtils(); + } + + /** + * Creates and returns a new instance of a {@link TilesConfigurer} class. + * + * @return New instance of {@link TilesConfigurer}. + */ + @Bean + public TilesConfigurer tilesConfigurer() { + TilesConfigurer tilesConfigurer = new TilesConfigurer(); + tilesConfigurer.setDefinitions(tileDefinitions()); + tilesConfigurer.setCheckRefresh(true); + return tilesConfigurer; + } + + /** + * + * Creates the Application Data Source. + * + * @return DataSource Object + * @throws Exception + * on failure to create data source object + */ + @Bean + public DataSource dataSource() throws Exception { + + systemProperties(); + + ComboPooledDataSource dataSource = new ComboPooledDataSource(); + try { + dataSource.setDriverClass(SystemProperties.getProperty(SystemProperties.DB_DRIVER)); + dataSource.setJdbcUrl(SystemProperties.getProperty(SystemProperties.DB_CONNECTIONURL)); + dataSource.setUser(SystemProperties.getProperty(SystemProperties.DB_USERNAME)); + String password = SystemProperties.getProperty(SystemProperties.DB_PASSWORD); + if (SystemProperties.containsProperty(SystemProperties.DB_ENCRYPT_FLAG)) { + String encryptFlag = SystemProperties.getProperty(SystemProperties.DB_ENCRYPT_FLAG); + if (encryptFlag != null && encryptFlag.equalsIgnoreCase("true")) { + password = CipherUtil.decrypt(password); + } + } + dataSource.setPassword(password); + dataSource + .setMinPoolSize(Integer.parseInt(SystemProperties.getProperty(SystemProperties.DB_MIN_POOL_SIZE))); + dataSource + .setMaxPoolSize(Integer.parseInt(SystemProperties.getProperty(SystemProperties.DB_MAX_POOL_SIZE))); + dataSource.setIdleConnectionTestPeriod( + Integer.parseInt(SystemProperties.getProperty(SystemProperties.IDLE_CONNECTION_TEST_PERIOD))); + dataSource.setTestConnectionOnCheckout(getConnectionOnCheckout()); + dataSource.setPreferredTestQuery(getPreferredTestQuery()); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Error initializing database, verify database settings in properties file: " + + UserUtils.getStackTrace(e), + AlarmSeverityEnum.CRITICAL); + logger.error(EELFLoggerDelegate.debugLogger, + "Error initializing database, verify database settings in properties file: " + + UserUtils.getStackTrace(e), + AlarmSeverityEnum.CRITICAL); + // Raise an alarm that opening a connection to the database failed. + logger.logEcompError(AppMessagesEnum.BeDaoSystemError); + throw e; + } + return dataSource; + } + + /** + * Gets the value of the property + * {@link SystemProperties#PREFERRED_TEST_QUERY}; defaults to "Select 1" if + * the property is not defined. + * + * @return String value that is a SQL query + */ + private String getPreferredTestQuery() { + // Use simple default + String preferredTestQueryStr = "SELECT 1"; + if (SystemProperties.containsProperty(SystemProperties.PREFERRED_TEST_QUERY)) { + preferredTestQueryStr = SystemProperties.getProperty(SystemProperties.PREFERRED_TEST_QUERY); + logger.debug(EELFLoggerDelegate.debugLogger, "getPreferredTestQuery: property key {} value is {}", + SystemProperties.PREFERRED_TEST_QUERY, preferredTestQueryStr); + } else { + logger.info(EELFLoggerDelegate.errorLogger, + "getPreferredTestQuery: property key {} not found, using default value {}", + SystemProperties.PREFERRED_TEST_QUERY, preferredTestQueryStr); + } + return preferredTestQueryStr; + } + + /** + * Gets the value of the property + * {@link SystemProperties#TEST_CONNECTION_ON_CHECKOUT}; defaults to true if + * the property is not defined. + * + * @return Boolean value + */ + private Boolean getConnectionOnCheckout() { + // Default to true, always test connection + boolean testConnectionOnCheckout = true; + if (SystemProperties.containsProperty(SystemProperties.TEST_CONNECTION_ON_CHECKOUT)) { + testConnectionOnCheckout = Boolean + .valueOf(SystemProperties.getProperty(SystemProperties.TEST_CONNECTION_ON_CHECKOUT)); + logger.debug(EELFLoggerDelegate.debugLogger, "getConnectionOnCheckout: property key {} value is {}", + SystemProperties.TEST_CONNECTION_ON_CHECKOUT, testConnectionOnCheckout); + } else { + logger.info(EELFLoggerDelegate.errorLogger, + "getConnectionOnCheckout: property key {} not found, using default value {}", + SystemProperties.TEST_CONNECTION_ON_CHECKOUT, testConnectionOnCheckout); + } + return testConnectionOnCheckout; + } + + /* + * TODO: Check whether it is appropriate to extend the list of tile + * definitions at every invocation. + */ + protected String[] tileDefinitions() { + tileDefinitions.add("/WEB-INF/fusion/defs/definitions.xml"); + tileDefinitions.addAll(addTileDefinitions()); + + return tileDefinitions.toArray(new String[0]); + } + + /** + * Creates and returns a new empty list. This method should be overridden by + * child classes. + * + * @return An empty list. + */ + public List addTileDefinitions() { + return new ArrayList(); + } + + /** + * Creates and returns a new instance of a primary (order=1) + * {@link UrlBasedViewResolver} that finds files using the contents of + * definitions.xml files. + * + * @return New instance of {@link UrlBasedViewResolver} + */ + @Bean + public UrlBasedViewResolver tileViewResolver() { + UrlBasedViewResolver viewResolver = new UrlBasedViewResolver(); + viewResolver.setViewClass(TilesView.class); + viewResolver.setOrder(1); + return viewResolver; + } + + /** + * Adds new instances of the following interceptors to the specified + * interceptor registry: {@link SessionTimeoutInterceptor}, + * {@link ResourceInterceptor} + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new SessionTimeoutInterceptor()) + .excludePathPatterns(getExcludeUrlPathsForSessionTimeout()); + registry.addInterceptor(resourceInterceptor()); + } + + /** + * Creates and returns a new instance of a {@link ResourceInterceptor}. + * + * @return New instance of {@link ResourceInterceptor} + */ + @Bean + public ResourceInterceptor resourceInterceptor() { + return new ResourceInterceptor(); + } + + private String[] excludeUrlPathsForSessionTimeout = {}; + + /** + * Gets the array of Strings that are paths excluded for session timeout. + * + * @return Array of String + */ + public String[] getExcludeUrlPathsForSessionTimeout() { + return excludeUrlPathsForSessionTimeout; + } + + /** + * Sets the array of Strings that are paths excluded for session timeout. + * + * @param excludeUrlPathsForSessionTimeout + * Paths to exclude + */ + public void setExcludeUrlPathsForSessionTimeout(final String... excludeUrlPathsForSessionTimeout) { + this.excludeUrlPathsForSessionTimeout = excludeUrlPathsForSessionTimeout; + } + + /* + * (non-Javadoc) + * + * @see + * org.springframework.context.ApplicationContextAware#setApplicationContext + * (org.springframework.context.ApplicationContext) + */ + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + appApplicationContext = applicationContext; + + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java new file mode 100644 index 00000000..0865b987 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java @@ -0,0 +1,88 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.conf; + +import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.springframework.core.env.ConfigurableEnvironment; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; + +public abstract class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppInitializer.class); + + private final String activeProfile = "src"; + + @Override + protected WebApplicationContext createServletApplicationContext() { + WebApplicationContext context = super.createServletApplicationContext(); + + try { + + ((ConfigurableEnvironment) context.getEnvironment()).setActiveProfiles(activeProfile); + } catch (Exception e) { + + logger.error(EELFLoggerDelegate.errorLogger, "Unable to set the active profile" + e.getMessage(),AlarmSeverityEnum.MAJOR); + throw e; + + } + + return context; + } + + @Override + protected Class[] getRootConfigClasses() { + return null; + } + + @Override + protected Class[] getServletConfigClasses() { + + return new Class[] { AppConfig.class }; + } + + /* + * URL request will direct to the Spring dispatcher for processing + */ + @Override + protected String[] getServletMappings() { + return new String[] { "/" }; + } + +} \ No newline at end of file diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java new file mode 100644 index 00000000..d890e609 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java @@ -0,0 +1,56 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.conf; + +import java.util.List; + +import org.onap.portalsdk.core.service.DataAccessService; +import org.springframework.web.servlet.ViewResolver; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; + +public interface Configurable { + + public ViewResolver viewResolver(); + + public void addResourceHandlers(ResourceHandlerRegistry registry) ; + + public DataAccessService dataAccessService(); + + public List addTileDefinitions(); + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java new file mode 100644 index 00000000..54512865 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java @@ -0,0 +1,162 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.conf; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import javax.sql.DataSource; + +import org.hibernate.SessionFactory; +import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.util.SystemProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.orm.hibernate4.HibernateTransactionManager; +import org.springframework.orm.hibernate4.LocalSessionFactoryBean; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import com.mchange.v2.c3p0.ComboPooledDataSource; + +@Configuration +@EnableTransactionManagement +public class HibernateConfiguration { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HibernateConfiguration.class); + + @Autowired + private HibernateMappingLocatable hbMappingLocatable; + + @Autowired + private DataSource dataSource; + + @Bean + public LocalSessionFactoryBean sessionFactory() { + LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); + sessionFactory.setDataSource(dataSource); + sessionFactory.setPackagesToScan(hbMappingLocatable.getPackagesToScan()); + sessionFactory.setHibernateProperties(getHibernateProperties()); + sessionFactory.setMappingLocations(hbMappingLocatable.getMappingLocations()); + return sessionFactory; + } + + /** + * Builds a properties object with Hibernate properties in te system.properties file. + * + * @return Properties object + */ + private Properties getHibernateProperties() { + Properties properties = new Properties(); + properties.put("hibernate.dialect", SystemProperties.getProperty(SystemProperties.HB_DIALECT)); + properties.put("hibernate.show_sql", SystemProperties.getProperty(SystemProperties.HB_SHOW_SQL)); + return properties; + } + + @SuppressWarnings("rawtypes") + @Bean + public Map dataSourceMap() throws Exception { + Connection conn = null; + Statement stmt = null; + ResultSet rs = null; + Map dataSourceMap = new HashMap(); + try { + conn = dataSource.getConnection(); + stmt = conn.createStatement(); + String sql = "SELECT schema_id,datasource_type,connection_url,user_name,password,driver_class,min_pool_size,max_pool_size,idle_connection_test_period FROM schema_info"; + rs = stmt.executeQuery(sql); + while (rs.next()) { + ComboPooledDataSource dataSource = new ComboPooledDataSource(); + dataSource.setDriverClass(rs.getString("driver_class")); + dataSource.setJdbcUrl(rs.getString("connection_url")); + dataSource.setUser(rs.getString("user_name")); + dataSource.setPassword(rs.getString("password")); + dataSource.setMinPoolSize(rs.getInt("min_pool_size")); + dataSource.setMaxPoolSize(rs.getInt("max_pool_size")); + dataSource.setIdleConnectionTestPeriod(rs.getInt("idle_connection_test_period")); + dataSourceMap.put(rs.getString("schema_id"), dataSource); + } + rs.close(); + rs = null; + stmt.close(); + stmt = null; + conn.close(); + conn = null; + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, + "Error initializing database, verify database settings in properties file: " + e.getMessage(), + AlarmSeverityEnum.CRITICAL); + e.printStackTrace(); + dataSourceMap = null; + throw e; + } finally { + try { + if (rs != null) + rs.close(); + if (stmt != null) + stmt.close(); + if (conn != null) + conn.close(); + } catch (SQLException se2) { + } + try { + if (conn != null) + conn.close(); + } catch (SQLException se) { + se.printStackTrace(); + } + } + + return dataSourceMap; + } + + @Bean + @Autowired + public HibernateTransactionManager transactionManager(SessionFactory s) { + HibernateTransactionManager txManager = new HibernateTransactionManager(); + txManager.setSessionFactory(s); + return txManager; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java new file mode 100644 index 00000000..743d4b76 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java @@ -0,0 +1,61 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.conf; + +import org.springframework.core.io.Resource; + +/** + * Defines methods used by developers to supply Hibernate configuration. + */ +public interface HibernateMappingLocatable { + + /** + * Gets Hibernate mapping locations. + * + * @return Array of Resource objects (usually ClassPathResource that's a + * file) which contain Hibernate mapping information. + */ + public Resource [] getMappingLocations(); + + /** + * Gets package names. + * + * @return Array of Java package names to scan for classes with Hibernate annotations. + */ + public String [] getPackagesToScan(); +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java new file mode 100644 index 00000000..48c145b3 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java @@ -0,0 +1,153 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.controller; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.onap.portalsdk.core.domain.MenuData; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.interfaces.SecurityInterface; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.menu.MenuBuilder; +import org.onap.portalsdk.core.service.AppService; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.core.service.FnMenuService; +import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.web.support.UserUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@Controller +public abstract class FusionBaseController implements SecurityInterface{ + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FusionBaseController.class); + + @Override + public boolean isAccessible() { + return true; + } + + public boolean isRESTfulCall(){ + return true; + } + @Autowired + private FnMenuService fnMenuService; + + @Autowired + private MenuBuilder menuBuilder; + + @Autowired + private DataAccessService dataAccessService; + + @Autowired + AppService appService; + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @ModelAttribute("menu") + public Map getMenu(HttpServletRequest request) { + HttpSession session = null; + Map model = new HashMap(); + try { + try { + String appName = appService.getDefaultAppName(); + if (appName==null || appName=="") { + appName = SystemProperties.SDK_NAME; + } + logger.setRequestBasedDefaultsIntoGlobalLoggingContext(request, appName); + } catch (Exception e) { + } + + session = request.getSession(); + User user = UserUtils.getUserSession(request); + if(session!=null && user!=null){ + Set menuResult = (Set) session.getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)); + if(menuResult==null){ + Set appMenu = getMenuBuilder().getMenu(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_SET_NAME),dataAccessService); + session.setAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME), MenuBuilder.filterMenu(appMenu, request)); + menuResult = (Set) session.getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)); + } + model = setMenu(menuResult); + } + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, e.getMessage()); + } + return model; + } + + public Map setMenu(Set menuResult) throws Exception{ + ObjectMapper mapper = new ObjectMapper(); + List> childItemList = new ArrayList>();; + List parentList = new ArrayList();; + Map model = new HashMap(); + try{ + fnMenuService.setMenuDataStructure(childItemList, parentList, menuResult); + }catch(Exception e){ + logger.error(EELFLoggerDelegate.errorLogger, e.getMessage()); + } + model.put("childItemList", mapper.writeValueAsString(childItemList)); + model.put("parentList", mapper.writeValueAsString(parentList)); + return model; + } + + public MenuBuilder getMenuBuilder() { + return menuBuilder; + } + + public void setMenuBuilder(MenuBuilder menuBuilder) { + this.menuBuilder = menuBuilder; + } + + public DataAccessService getDataAccessService() { + return dataAccessService; + } + + public void setDataAccessService(DataAccessService dataAccessService) { + this.dataAccessService = dataAccessService; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java new file mode 100644 index 00000000..1659dc32 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java @@ -0,0 +1,68 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.controller; + +public class RestrictedBaseController extends FusionBaseController{ + + protected String viewName; + private String exceptionView; + @Override + public boolean isAccessible() { + return false; + } + @Override + public boolean isRESTfulCall(){ + return false; + } + protected String getViewName() { + return viewName; + } + protected void setViewName(String viewName) { + this.viewName = viewName; + } + + public String getExceptionView() { + return (exceptionView == null) ? "runtime_error_handler" : exceptionView; + } + + public void setExceptionView(String exceptionView) { + this.exceptionView = exceptionView; + } + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java new file mode 100644 index 00000000..1dfffaa0 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java @@ -0,0 +1,68 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.controller; + +public class RestrictedRESTfulBaseController extends FusionBaseController{ + + protected String viewName; + private String exceptionView; + @Override + public boolean isAccessible() { + return false; + } + @Override + public boolean isRESTfulCall(){ + return true; + } + protected String getViewName() { + return viewName; + } + protected void setViewName(String viewName) { + this.viewName = viewName; + } + + public String getExceptionView() { + return (exceptionView == null) ? "runtime_error_handler" : exceptionView; + } + + public void setExceptionView(String exceptionView) { + this.exceptionView = exceptionView; + } + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java new file mode 100644 index 00000000..81f0c54d --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java @@ -0,0 +1,58 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.controller; + +public class UnRestrictedBaseController extends FusionBaseController{ + protected String viewName; + + @Override + public boolean isAccessible() { + return true; + } + @Override + public boolean isRESTfulCall(){ + return false; + } + protected String getViewName() { + return viewName; + } + + protected void setViewName(String viewName) { + this.viewName = viewName; + } +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java new file mode 100644 index 00000000..c1d063a9 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java @@ -0,0 +1,80 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.dao; +import java.io.Serializable; +import java.lang.reflect.ParameterizedType; + +import org.hibernate.Criteria; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public abstract class AbstractDao { + + private final Class persistentClass; + + @SuppressWarnings("unchecked") + public AbstractDao(){ + this.persistentClass =(Class) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[1]; + } + + @Autowired + private SessionFactory sessionFactory; + + protected Session getSession(){ + return sessionFactory.getCurrentSession(); + } + + @SuppressWarnings("unchecked") + public T getByKey(PK key) { + return (T) getSession().get(persistentClass, key); + } + + public void persist(T entity) { + getSession().persist(entity); + } + + public void delete(T entity) { + getSession().delete(entity); + } + + protected Criteria createEntityCriteria(){ + return getSession().createCriteria(persistentClass); + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java new file mode 100644 index 00000000..bb93ac36 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java @@ -0,0 +1,47 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.dao; + +import java.util.List; + +import org.onap.portalsdk.core.domain.Profile; + +public interface ProfileDao { + List findAll(); + Profile getProfile(int id); +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java new file mode 100644 index 00000000..ee6c32d3 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java @@ -0,0 +1,69 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.dao; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.onap.portalsdk.core.dao.AbstractDao; +import org.onap.portalsdk.core.domain.Profile; +import org.springframework.stereotype.Repository; + +@Repository("profileDao") +public class ProfileDaoImpl extends AbstractDao implements ProfileDao{ + + + public List findAll() { + Criteria crit = getSession().createCriteria(Profile.class); + @SuppressWarnings("unchecked") + List p = crit.list(); + + return p; + } + + + public Profile getProfile(int id) { + Criteria crit = getSession().createCriteria(Profile.class); + crit.add(Restrictions.eq("id", id)); + Profile profile = (Profile) crit.uniqueResult(); + + return profile; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java new file mode 100644 index 00000000..2c3fa5da --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java @@ -0,0 +1,471 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.dao.hibernate; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.hibernate.Criteria; +import org.hibernate.FetchMode; +import org.hibernate.Query; +import org.hibernate.SQLQuery; +import org.hibernate.Session; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.ProjectionList; +import org.hibernate.type.LongType; +import org.onap.portalsdk.core.dao.support.FusionDao; +import org.onap.portalsdk.core.domain.Lookup; +import org.onap.portalsdk.core.domain.support.DomainVo; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.util.SystemProperties; + +public abstract class ModelOperationsCommon extends FusionDao { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ModelOperationsCommon.class); + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public List _getList(Class domainClass, String filterClause, Integer fromIndex, Integer toIndex, String orderBy) { + List list = null; + String className = domainClass.getName(); + + Session session = getSessionFactory().getCurrentSession(); + + logger.info(EELFLoggerDelegate.debugLogger, "Getting " + className.toLowerCase() + " records" + + ((fromIndex != null) ? " from rows " + fromIndex.toString() + " to " + toIndex.toString() : "") + + "..."); + + + if (filterClause != null && filterClause.length() > 0) { + logger.info(EELFLoggerDelegate.debugLogger, "Filtering " + className + " by: " + filterClause); + + } + + list = session.createQuery("from " + className + Utilities.nvl(filterClause, "") + + ((orderBy != null) ? " order by " + orderBy : "")).list(); + list = (fromIndex != null) ? list.subList(fromIndex.intValue() - 1, toIndex.intValue()) : list; + + if (orderBy == null && list != null) { + Collections.sort(list); + } + + return list; + } + + public List _getList(Class domainClass, ProjectionList projectionsList, List restrictionsList, + List orderByList) { + return _getList(domainClass, projectionsList, restrictionsList, orderByList, null); + } + + public List _getList(Class domainClass, ProjectionList projectionsList, List restrictionsList, + List orderByList, HashMap fetchModeMap) { + + Session session = getSessionFactory().getCurrentSession(); + + Criteria criteria = session.createCriteria(domainClass); + + if (projectionsList != null) { + criteria.setProjection(projectionsList); + } + + if (restrictionsList != null && !restrictionsList.isEmpty()) { + for (Criterion criterion : restrictionsList) + criteria.add(criterion); + } + + if (orderByList != null && !orderByList.isEmpty()) { + for (Order order : orderByList) + criteria.addOrder(order); + } + + if (fetchModeMap != null) { + Iterator itr = fetchModeMap.keySet().iterator(); + String key = null; + while (itr.hasNext()) { + key = itr.next(); + criteria.setFetchMode(key, fetchModeMap.get(key)); + } + + } + return criteria.list(); + } + + @SuppressWarnings("rawtypes") + public DomainVo _get(Class domainClass, Serializable id) { + DomainVo vo = null; + + Session session = getSessionFactory().getCurrentSession(); + + logger.info(EELFLoggerDelegate.debugLogger, "Getting " + domainClass.getName() + " record for id - " + id.toString()); + + + vo = (DomainVo) session.get(domainClass, id); + + if (vo == null) { + try { + vo = (DomainVo) domainClass.newInstance(); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "Failed while instantiating a class of " + domainClass.getName() + e.getMessage()); + + } + } + + return vo; + } + + @SuppressWarnings("rawtypes") + public List _getLookupList(String dbTable, String dbValueCol, String dbLabelCol, String dbFilter, String dbOrderBy, + HashMap additionalParams) { + logger.info(EELFLoggerDelegate.debugLogger, "Retrieving " + dbTable + " lookup list..."); + + List list = null; + String dbOrderByCol = dbOrderBy; + + Session session = getSessionFactory().getCurrentSession(); + + // default the orderBy if null; + if (Utilities.nvl(dbOrderBy).length() == 0) { + dbOrderByCol = dbLabelCol; + dbOrderBy = dbLabelCol; + } else { + if (dbOrderBy.lastIndexOf(" ") > -1) { + dbOrderByCol = dbOrderBy.substring(0, dbOrderBy.lastIndexOf(" ")); + } + } + + StringBuffer sql = new StringBuffer(); + + sql.append("select distinct ").append(dbLabelCol).append(" as lab, ").append(dbValueCol).append(" as val, ") + .append(dbOrderByCol).append(" as sortOrder ").append("from ").append(dbTable).append(" ") + .append((Utilities.nvl(dbFilter).length() == 0) ? "" : (" where " + dbFilter)).append(" order by ") + .append(dbOrderBy); + + try { + list = session.createSQLQuery(sql.toString()).addEntity(Lookup.class).list(); + } catch (Exception e) { + list = null; + logger.info(EELFLoggerDelegate.debugLogger, "The results for the lookup list query [" + sql + "] were empty."); + } + + return list; + } // getLookupList + + /* This method is used to execute SQL queries */ + @SuppressWarnings("rawtypes") + protected final List _executeSQLQuery(String sql, Class domainClass) { + return _executeSQLQuery(sql, domainClass, null, null); + } + + /* This method is used to execute SQL queries with paging */ + @SuppressWarnings("rawtypes") + protected final List _executeSQLQuery(String sql, Class domainClass, Integer fromIndex, Integer toIndex) { + Session session = getSessionFactory().getCurrentSession(); + + SQLQuery query = session.createSQLQuery(sql).addEntity(domainClass.getName().toLowerCase(), domainClass); + + if (fromIndex != null && toIndex != null) { + query.setFirstResult(fromIndex.intValue()); + int pageSize = (toIndex.intValue() - fromIndex.intValue()) + 1; + query.setMaxResults(pageSize); + } + + return query.list(); + } + + /* This method is used to execute HQL queries */ + @SuppressWarnings("rawtypes") + protected final List _executeQuery(String sql) { + return _executeQuery(sql, null, null); + } + + /* This method is used to execute HQL queries with paging */ + @SuppressWarnings("rawtypes") + protected final List _executeQuery(String sql, Integer fromIndex, Integer toIndex) { + Session session = getSessionFactory().getCurrentSession(); + + Query query = session.createQuery(sql); + + if (fromIndex != null && toIndex != null) { + query.setFirstResult(fromIndex.intValue()); + int pageSize = (toIndex.intValue() - fromIndex.intValue()) + 1; + query.setMaxResults(pageSize); + } + + return query.list(); + } + + /* + * This method can be used to execute both HQL or SQL named queries. The + * distinction will come in the hbm.xml mapping file defining the named + * query. Named HQL queries use the tag while named SQL queries use + * the tag. + */ + @SuppressWarnings("rawtypes") + protected final List _executeNamedQuery(String queryName, Map params) { + return _executeNamedQuery(queryName, params, null, null); + } + + /* + * This method can be used to execute both HQL or SQL named queries with + * paging. The distinction will come in the hbm.xml mapping file defining + * the named query. Named HQL queries use the tag while named SQL + * queries use the tag. + */ + @SuppressWarnings("rawtypes") + protected final List _executeNamedQuery(String queryName, Map params, Integer fromIndex, Integer toIndex) { + Session session = getSessionFactory().getCurrentSession(); + Query query = session.getNamedQuery(queryName); + bindQueryParameters(query, params); + if (fromIndex != null && toIndex != null) { + query.setFirstResult(fromIndex.intValue()); + int pageSize = (toIndex.intValue() - fromIndex.intValue()) + 1; + query.setMaxResults(pageSize); + } + return query.list(); + } + + // RAPTOR ZK + /* + * This method can be used to execute both HQL or SQL named queries with + * paging. The distinction will come in the hbm.xml mapping file defining + * the named query. Named HQL queries use the tag while named SQL + * queries use the tag. + */ + @SuppressWarnings("rawtypes") + protected final List _executeNamedCountQuery(Class entity, String queryName, String whereClause, Map params) { + Session session = getSessionFactory().getCurrentSession(); + Query query = session.getNamedQuery(queryName); + String queryStr = query.getQueryString(); + StringBuffer modifiedSql = new StringBuffer(" select count(*) as countRows from (" + queryStr + " ) al "); + if (whereClause != null && whereClause.length() > 0) + modifiedSql.append("where " + whereClause); + // SQLQuery sqlQuery = session.createSQLQuery(" select count(*) as + // {reportSearch.countRows} from ("+ modifiedSql.toString()+")"); + SQLQuery sqlQuery = session.createSQLQuery(modifiedSql.toString()); + bindQueryParameters(sqlQuery, params); + sqlQuery.addScalar("countRows", LongType.INSTANCE); + // sqlQuery.addEntity("reportSearch", entity); + // sqlQuery.setResultTransformer(new + // AliasToBeanResultTransformer(SearchCount.class)); + return sqlQuery.list(); + + } + + /* + * This method can be used to execute both HQL or SQL named queries with + * paging. The distinction will come in the hbm.xml mapping file defining + * the named query. Named HQL queries use the tag while named SQL + * queries use the tag. It is modified to test ZK filter. + */ + @SuppressWarnings("rawtypes") + protected final List _executeNamedQuery(Class entity, String queryName, String whereClause, Map params, + Integer fromIndex, Integer toIndex) { + Session session = getSessionFactory().getCurrentSession(); + Query query = session.getNamedQuery(queryName); + bindQueryParameters(query, params); + String queryStr = query.getQueryString(); + StringBuffer modifiedSql = new StringBuffer(" select * from (" + queryStr + " ) al "); + if (whereClause != null && whereClause.length() > 0) + modifiedSql.append("where " + whereClause); + + SQLQuery sqlQuery = session.createSQLQuery(modifiedSql.toString()); + bindQueryParameters(sqlQuery, params); + sqlQuery.addEntity("reportSearch", entity); + + if (fromIndex != null && toIndex != null) { + sqlQuery.setFirstResult(fromIndex.intValue()); + int pageSize = (toIndex.intValue() - fromIndex.intValue()) + 1; + sqlQuery.setMaxResults(pageSize); + } + return sqlQuery.list(); + } + + /* + * This method can be used to execute both HQL or SQL named queries with + * paging. The distinction will come in the hbm.xml mapping file defining + * the named query. Named HQL queries use the tag while named SQL + * queries use the tag. + */ + @SuppressWarnings("rawtypes") + protected final List _executeNamedQueryWithOrderBy(Class entity, String queryName, Map params, String _orderBy, + boolean asc, Integer fromIndex, Integer toIndex) { + Session session = getSessionFactory().getCurrentSession(); + Query query = session.getNamedQuery(queryName); + bindQueryParameters(query, params); + String queryStr = query.getQueryString(); + queryStr = String.format(queryStr, _orderBy, asc ? "ASC" : "DESC"); + SQLQuery sqlQuery = session.createSQLQuery(queryStr); + bindQueryParameters(sqlQuery, params); + sqlQuery.addEntity("reportSearch", entity); + if (fromIndex != null && toIndex != null) { + sqlQuery.setFirstResult(fromIndex.intValue()); + int pageSize = (toIndex.intValue() - fromIndex.intValue()) + 1; + sqlQuery.setMaxResults(pageSize); + } + return sqlQuery.list(); + } + + // Where Clause + @SuppressWarnings("rawtypes") + protected final List _executeNamedQueryWithOrderBy(Class entity, String queryName, String whereClause, Map params, + String _orderBy, boolean asc, Integer fromIndex, Integer toIndex) { + Session session = getSessionFactory().getCurrentSession(); + Query query = session.getNamedQuery(queryName); + bindQueryParameters(query, params); + String queryStr = query.getQueryString(); + queryStr = String.format(queryStr, _orderBy, asc ? "ASC" : "DESC"); + // StringBuffer modifiedSql = new StringBuffer(queryStr ); + StringBuffer modifiedSql = new StringBuffer(" select * from (" + queryStr + " ) al "); + // modifiedSql.insert(queryStr.lastIndexOf("order by"), " " + + // whereClause + " "); + if (whereClause != null && whereClause.length() > 0) + modifiedSql.append("where " + whereClause); + SQLQuery sqlQuery = session.createSQLQuery(modifiedSql.toString()); + bindQueryParameters(sqlQuery, params); + sqlQuery.addEntity("reportSearch", entity); + if (fromIndex != null && toIndex != null) { + sqlQuery.setFirstResult(fromIndex.intValue()); + int pageSize = (toIndex.intValue() - fromIndex.intValue()) + 1; + sqlQuery.setMaxResults(pageSize); + } + return sqlQuery.list(); + } + + // RAPTOR ZK END + + /* Processes custom Insert/Update/Delete SQL statements */ + protected final int _executeUpdateQuery(String sql) throws Exception { + Session session = getSessionFactory().getCurrentSession(); + Query query = session.createSQLQuery(sql); + return query.executeUpdate(); + } + + /* Processes Insert/Update/Delete Named SQL statements */ + @SuppressWarnings("rawtypes") + protected final int _executeNamedUpdateQuery(String queryName, Map params) throws Exception { + Session session = getSessionFactory().getCurrentSession(); + Query query = session.getNamedQuery(queryName); + bindQueryParameters(query, params); + return query.executeUpdate(); + } + + protected final void _update(DomainVo vo, Integer userId) { + _update(vo, ((userId != null) ? userId.intValue() : 0)); + } + + protected final void _update(DomainVo vo, int userId) { + Date timestamp = new Date(); + + Session session = getSessionFactory().getCurrentSession(); + + if (vo.getId() == null || vo.getId().intValue() == 0) { // add new + vo.setCreated(timestamp); + vo.setModified(timestamp); + + if (userId != 0 + && userId != Integer.parseInt(SystemProperties.getProperty(SystemProperties.APPLICATION_USER_ID))) { + vo.setCreatedId(new Long(userId)); + vo.setModifiedId(new Long(userId)); + } + } else { // update existing + vo.setModified(timestamp); + + if (userId != 0 + && userId != Integer.parseInt(SystemProperties.getProperty(SystemProperties.APPLICATION_USER_ID))) { + vo.setModifiedId(new Long(userId)); + } + } + + session.saveOrUpdate(vo); + } + + protected final void _remove(DomainVo vo) { + Session session = getSessionFactory().getCurrentSession(); + session.delete(vo); + } + + @SuppressWarnings("rawtypes") + protected final int _remove(Class domainClass, String whereClause) { + int rowsAffected = 0; + + Session session = getSessionFactory().getCurrentSession(); + + StringBuffer sql = new StringBuffer("delete from "); + + sql.append(domainClass.getName()).append(" where ").append(whereClause); + + rowsAffected = session.createQuery(sql.toString()).executeUpdate(); + + return rowsAffected; + } + + protected final void _flush() { + Session session = getSessionFactory().getCurrentSession(); + session.flush(); + } + + @SuppressWarnings("rawtypes") + private void bindQueryParameters(Query query, Map params) { + if (params != null) { + for (Iterator i = params.entrySet().iterator(); i.hasNext();) { + Map.Entry entry = (Map.Entry) i.next(); + + Object parameterValue = entry.getValue(); + + if (!(parameterValue instanceof Collection) && !(parameterValue instanceof Object[])) { + query.setParameter((String) entry.getKey(), parameterValue); + } else { + if (parameterValue instanceof Collection) { + query.setParameterList((String) entry.getKey(), (Collection) parameterValue); + } else { + if (parameterValue instanceof Object[]) { + query.setParameterList((String) entry.getKey(), (Object[]) parameterValue); + } + } + } + } + } + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java new file mode 100644 index 00000000..a3ff27fd --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java @@ -0,0 +1,53 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.dao.support; + +import org.hibernate.SessionFactory; +import org.onap.portalsdk.core.FusionObject; + +public class FusionDao implements FusionObject { + private SessionFactory sessionFactory; + + public void setSessionFactory(SessionFactory sessionFactory) { + this.sessionFactory = sessionFactory; + } + + public SessionFactory getSessionFactory() { + return this.sessionFactory; + } +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java new file mode 100644 index 00000000..dfc4ae3c --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java @@ -0,0 +1,224 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + +import org.onap.portalsdk.core.domain.support.DomainVo; + +/** + * Represents a row in the FN_APP table in the EP_SDK database. (A nearly + * identical table is defined in Portal database.) + * + * @version 1.0 + */ +public class App extends DomainVo { + + private static final long serialVersionUID = 3465979916929796990L; + + // superclass defines Id + private String name; // app_name + private String imageUrl; // app_image_url + private String description; // app_description + private String notes; // app_notes + private String url; // app_url + private String alternateUrl; // app_alternate_url + private String restEndpoint; // app_rest_endpoint + private String mlAppName; // ml_app_name + private String mlAppAdminId; // ml_app_admin_id; + private String motsId; // mots_id + private String appPassword; // app_password + private String open; + private String enabled; + private byte[] thumbnail; + private String username; // app_username + private String uebKey; // ueb_key + private String uebSecret; // ueb_secret + private String uebTopicName; // ueb_topic_name + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAppPassword() { + return appPassword; + } + + public void setAppPassword(String appPassword) { + this.appPassword = appPassword; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getAlternateUrl() { + return alternateUrl; + } + + public void setAlternateUrl(String alternateUrl) { + this.alternateUrl = alternateUrl; + } + + public String getRestEndpoint() { + return restEndpoint; + } + + public void setRestEndpoint(String restEndpoint) { + this.restEndpoint = restEndpoint; + } + + public String getMlAppName() { + return mlAppName; + } + + public void setMlAppName(String mlAppName) { + this.mlAppName = mlAppName; + } + + public String getMlAppAdminId() { + return mlAppAdminId; + } + + public void setMlAppAdminId(String mlAppAdminId) { + this.mlAppAdminId = mlAppAdminId; + } + + public String getMotsId() { + return motsId; + } + + public void setMotsId(String motsId) { + this.motsId = motsId; + } + + public String getOpen() { + return open; + } + + public void setOpen(String open) { + this.open = open; + } + + public String getEnabled() { + return enabled; + } + + public void setEnabled(String enabled) { + this.enabled = enabled; + } + + public byte[] getThumbnail() { + return this.thumbnail; + } + + public void setThumbnail(byte[] thumbnail) { + this.thumbnail = thumbnail; + } + + public String getUebKey() { + return uebKey; + } + + public void setUebKey(String uebKey) { + this.uebKey = uebKey; + } + + public String getUebSecret() { + return uebSecret; + } + + public void setUebSecret(String uebSecret) { + this.uebSecret = uebSecret; + } + + public String getUebTopicName() { + return uebTopicName; + } + + public void setUebTopicName(String uebTopicName) { + this.uebTopicName = uebTopicName; + } + + /** + * Answers true if the objects have the same ID. + */ + public int compareTo(Object obj) { + Long c1 = getId(); + Long c2 = ((App) obj).getId(); + return c1.compareTo(c2); + } +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java new file mode 100644 index 00000000..7cebc1af --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java @@ -0,0 +1,124 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + +import java.util.Date; + +import org.onap.portalsdk.core.domain.support.DomainVo; + +public class AuditLog extends DomainVo { + + /** + * + */ + private static final long serialVersionUID = 1L; + public static final String CD_ACTIVITY_LOGIN = "login"; + public static final String CD_ACTIVITY_LOGOUT = "logout"; + public static final String CD_ACTIVITY_MOBILE_LOGIN = "mobile_login"; + public static final String CD_ACTIVITY_MOBILE_LOGOUT = "mobile_logout"; + + /*-------Profile activities -----------*/ + public static final String CD_ACTIVITY_ROLE_ADD = "add_role"; + public static final String CD_ACTIVITY_ROLE_REMOVE = "remove_role"; + public static final String CD_ACTIVITY_CHILD_ROLE_ADD = "add_child_role"; + public static final String CD_ACTIVITY_CHILD_ROLE_REMOVE = "remove_child_role"; + public static final String CD_ACTIVITY_ROLE_ADD_FUNCTION = "add_role_function"; + public static final String CD_ACTIVITY_ROLE_REMOVE_FUNCTION = "remove_role_function"; + public static final String CD_ACTIVITY_USER_ROLE_ADD = "add_user_role"; + public static final String CD_ACTIVITY_USER_ROLE_REMOVE = "remove_user_role"; + + /*Audit activities*/ + public static final String CD_ACTIVITY_FUNCTIONAL_ACCESS = "functional_access"; + public static final String CD_ACTIVITY_TAB_ACCESS = "tab_access"; + public static final String CD_ACTIVITY_APP_ACCESS = "app_access"; + public static final String CD_ACTIVITY_LEFT_MENU_ACCESS = "left_menu_access"; + + + private String activityCode; + private String affectedRecordId; + private String comments; + private Date auditDate; + private Long userId; + + public AuditLog() { + setCreated(new Date()); + } + + public String getActivityCode() { + return activityCode; + } + + public String getComments() { + return comments; + } + + public String getAffectedRecordId() { + return affectedRecordId; + } + + public void setActivityCode(String activityCode) { + this.activityCode = activityCode; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public void setAffectedRecordId(String affectedRecordId) { + this.affectedRecordId = affectedRecordId; + } + + public Date getAuditDate() { + return auditDate; + } + + public void setAuditDate(Date auditDate) { + this.auditDate = auditDate; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java new file mode 100644 index 00000000..d75a030a --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java @@ -0,0 +1,142 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + +import java.util.*; + +import org.onap.portalsdk.core.domain.support.DomainVo; + +public class BroadcastMessage extends DomainVo { + + /** + * + */ + + private static final long serialVersionUID = 1L; + public BroadcastMessage() { + } + + public static final String ID_MESSAGE_LOCATION_LOGIN = "10"; + public static final String ID_MESSAGE_LOCATION_WELCOME = "20"; + + private String messageText; + private Integer locationId; + private Date startDate; + private Date endDate; + private Integer sortOrder; + private Boolean active; + private String siteCd; + + public Boolean getActive() { + return active; + } + + public Date getEndDate() { + return endDate; + } + + public Integer getLocationId() { + return locationId; + } + + public String getMessageText() { + return messageText; + } + + public Integer getSortOrder() { + return sortOrder; + } + + public Date getStartDate() { + return startDate; + } + + public String getSiteCd() { + return siteCd; + } + + + public void setActive(Boolean active) { + this.active = active; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + public void setLocationId(Integer locationId) { + this.locationId = locationId; + } + + public void setMessageText(String messageText) { + this.messageText = messageText; + } + + public void setSortOrder(Integer sortOrder) { + this.sortOrder = sortOrder; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public void setSiteCd(String siteCd) { + this.siteCd = siteCd; + } + + + public int compareTo(Object obj){ + Integer c1 = getLocationId(); + Integer c2 = ((BroadcastMessage)obj).getLocationId(); + + if (c1.compareTo(c2) == 0) { + c1 = getSortOrder(); + c2 = ((BroadcastMessage)obj).getSortOrder(); + + if (c1.compareTo(c2) == 0) { + Long c3 = getId(); + Long c4 = ((BroadcastMessage)obj).getId(); + + return c3.compareTo(c4); + } + } + + return c1.compareTo(c2); + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java new file mode 100644 index 00000000..355f36cb --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java @@ -0,0 +1,195 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +/* Super class from which all data objects descend + * + * Per Sunder T on 3 June 2016: + * + * Yes, we need to get rid of domain.DomainVO and fold all the references to the support.DomainVO. + */ +@SuppressWarnings("rawtypes") +@Deprecated +public class DomainVo extends FusionVo implements Serializable, Cloneable, Comparable { + + /** + * + */ + private static final long serialVersionUID = 1L; + protected Long id; + protected Date created; + protected Date modified; + protected Long createdId; + protected Long modifiedId; + protected Long rowNum; + + protected Serializable auditUserId; + + Set auditTrail = null; + + public DomainVo() { + } + + public void setId(Long i) { + id = i; + } + + public void setCreated(Date created) { + this.created = created; + } + + public void setModified(Date modified) { + this.modified = modified; + } + + public void setCreatedId(Long createdId) { + this.createdId = createdId; + } + + public void setModifiedId(Long modifiedId) { + this.modifiedId = modifiedId; + } + + public void setAuditUserId(Serializable auditUserId) { + this.auditUserId = auditUserId; + } + + public void setRowNum(Long rowNum) { + this.rowNum = rowNum; + } + + public void setAuditTrail(Set auditTrail) { + this.auditTrail = auditTrail; + } + + public Long getId() { + return id; + } + + public Date getCreated() { + return created; + } + + public Date getModified() { + return modified; + } + + public Long getCreatedId() { + return createdId; + } + + public Long getModifiedId() { + return modifiedId; + } + + public Serializable getAuditUserId() { + return auditUserId; + } + + public Long getRowNum() { + return rowNum; + } + + public Set getAuditTrail() { + return auditTrail; + } + + @SuppressWarnings("unchecked") + public void addAuditTrailLog(AuditLog auditLog) { + if (getAuditTrail() == null) { + setAuditTrail(new HashSet()); + } + + getAuditTrail().add(auditLog); + } + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + public Object copy() { + return copy(false); + } + + public Object copy(boolean isIdNull) { + // let's create a "copy" of the object using serialization + ByteArrayOutputStream baos = null; + ByteArrayInputStream bais = null; + ObjectOutputStream oos = null; + ObjectInputStream ois = null; + + DomainVo newVo = null; + + try { + + baos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(baos); + oos.writeObject(this); + + bais = new ByteArrayInputStream(baos.toByteArray()); + ois = new ObjectInputStream(bais); + newVo = (DomainVo) ois.readObject(); + + if (isIdNull) { + newVo.setId(null); + } + + } catch (Exception e) { + e.printStackTrace(); + } + + return newVo; + } + + public int compareTo(Object obj) { + Long c1 = getId(); + Long c2 = ((DomainVo) obj).getId(); + + return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2); + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java new file mode 100644 index 00000000..f4ed41e4 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java @@ -0,0 +1,159 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + + +import org.onap.portalsdk.core.domain.support.DomainVo; + +/** + *

RoleFunction.java

+ * + *

Represents a role function data object.

+ * + * @version 1.0 + */ +public class FnMenu extends DomainVo { + /** + * + */ + private static final long serialVersionUID = 1L; + public FnMenu() {} + + private Integer menuId; + private String label; + private Integer parentId; + private String action; + private String functionCd; + private Integer sortOrder; + private String servlet; + private String queryString; + private String externalUrl; + private String target; + private String active; + private String separator; + private String imageSrc; + private String menuSetCode; + + public Integer getMenuId() { + return menuId; + } + public void setMenuId(Integer menuId) { + this.menuId = menuId; + } + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } + public Integer getParentId() { + return parentId; + } + public void setParentId(Integer parentId) { + this.parentId = parentId; + } + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + public String getFunctionCd() { + return functionCd; + } + public void setFunctionCd(String functionCd) { + this.functionCd = functionCd; + } + public Integer getSortOrder() { + return sortOrder; + } + public void setSortOrder(Integer sortOrder) { + this.sortOrder = sortOrder; + } + public String getServlet() { + return servlet; + } + public void setServlet(String servlet) { + this.servlet = servlet; + } + public String getQueryString() { + return queryString; + } + public void setQueryString(String queryString) { + this.queryString = queryString; + } + public String getExternalUrl() { + return externalUrl; + } + public void setExternalUrl(String externalUrl) { + this.externalUrl = externalUrl; + } + public String getTarget() { + return target; + } + public void setTarget(String target) { + this.target = target; + } + public String getActive() { + return active; + } + public void setActive(String active) { + this.active = active; + } + public String getSeparator() { + return separator; + } + public void setSeparator(String separator) { + this.separator = separator; + } + public String getImageSrc() { + return imageSrc; + } + public void setImageSrc(String imageSrc) { + this.imageSrc = imageSrc; + } + public String getMenuSetCode() { + return menuSetCode; + } + public void setMenuSetCode(String menuSetCode) { + this.menuSetCode = menuSetCode; + } + + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java new file mode 100644 index 00000000..bf2321ba --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java @@ -0,0 +1,45 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + +import org.onap.portalsdk.core.FusionObject; + +public class FusionVo implements FusionObject { + public FusionVo() { + } +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java new file mode 100644 index 00000000..742f26b6 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java @@ -0,0 +1,205 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + +import java.util.Set; + +import org.onap.portalsdk.core.domain.support.FusionCommand; + +@SuppressWarnings("rawtypes") +public class LoginBean extends FusionCommand { + + private String loginId; + private String loginPwd; + private String hrid; + private String orgUserId; + private String siteAccess; + private String loginErrorMessage; + + private User user; + private Set menu; + private Set businessDirectMenu; + + /** + * getLoginId + * + * @return String + */ + public String getLoginId() { + return loginId; + } + + /** + * getLoginPwd + * + * @return String + */ + public String getLoginPwd() { + return loginPwd; + } + + /** + * getMenu + * + * @return Set + */ + public Set getMenu() { + return menu; + } + + /** + * getUser + * + * @return User + */ + public User getUser() { + return user; + } + + /** + * getHrid + * + * @return String + */ + public String getHrid() { + return hrid; + } + + /** + * getSiteAccess + * + * @return String + */ + public String getSiteAccess() { + return siteAccess; + } + + /** + * getBusinessDirectMenu + * + * @return Set + */ + public Set getBusinessDirectMenu() { + return businessDirectMenu; + } + + /** + * getLoginErrorMessage + * + * @return String + */ + public String getLoginErrorMessage() { + return loginErrorMessage; + } + + public String getOrgUserId() { + return orgUserId; + } + + /** + * setLoginId + * + * @param loginId String + */ + public void setLoginId(String loginId) { + this.loginId = loginId; + } + + /** + * setLoginPwd + * + * @param loginPwd String + */ + public void setLoginPwd(String loginPwd) { + this.loginPwd = loginPwd; + } + + public void setMenu(Set menu) { + this.menu = menu; + } + + /** + * setUser + * + * @param user User + */ + public void setUser(User user) { + this.user = user; + } + + /** + * setHrid + * + * @param hrid String + */ + public void setHrid(String hrid) { + this.hrid = hrid; + } + + /** + * setSiteAccess + * + * @param siteAccess String + */ + public void setSiteAccess(String siteAccess) { + this.siteAccess = siteAccess; + } + + /** + * setBusinessDirectMenu + * + * @param businessDirectMenu Set + */ + public void setBusinessDirectMenu(Set businessDirectMenu) { + this.businessDirectMenu = businessDirectMenu; + } + + /** + * setLoginErrorMessage + * + * @param loginErrorMessage String + */ + public void setLoginErrorMessage(String loginErrorMessage) { + this.loginErrorMessage = loginErrorMessage; + } + + public void setOrgUserId(String orgUserId) { + this.orgUserId = orgUserId; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java new file mode 100644 index 00000000..6248de85 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java @@ -0,0 +1,99 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.core.domain; + +import java.io.Serializable; +import java.util.Objects; + +import org.onap.portalsdk.core.domain.support.NameValueId; + +public class Lookup extends FusionVo implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + private NameValueId nameValueId = new NameValueId(); + + public Lookup() {} + + public Lookup(String label, String value) { + this(); + setLabel(label); + setValue(value); + } + + public String getValue() { + return getNameValueId().getVal(); + } + + public String getLabel() { + return getNameValueId().getLab(); + } + + public void setValue(String value) { + getNameValueId().setVal(value); + } + + public void setLabel(String label) { + getNameValueId().setLab(label); + } + + public NameValueId getNameValueId() { + return nameValueId; + } + + public void setNameValueId(NameValueId nameValueId) { + this.nameValueId = nameValueId; + } + + // required by ZK for to set the selectedItems of Listboxes (used heavily for -style drop-downs) - public int hashCode() { - int hash = getValue().hashCode(); - hash = hash + getLabel().hashCode(); - - return hash; - } - - public boolean equals( Object obj ) { - boolean equivalent = false; - - Lookup lookup = (Lookup)obj; - if( lookup.getValue().equals(getValue()) && lookup.getLabel().equals(getLabel())) { - equivalent = true; - } - - return equivalent; - } - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuCountry.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuCountry.java deleted file mode 100644 index f0237892..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuCountry.java +++ /dev/null @@ -1,87 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - - -import org.openecomp.portalsdk.core.domain.support.*; - - -/** - *

luCountry.java

- * - *

Represents a country data object.

- * - * @version 1.0 - */ -public class LuCountry extends DomainVo { - - /** - * - */ - private static final long serialVersionUID = 1L; - LuCountry() {} - - public String getCountry() { - return country; - } - - public String getAbbr() { - return abbr; - } - - public void setCountry(String country) { - this.country = country; - } - - public void setAbbr(String abbr) { - this.abbr = abbr; - } - - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public String getWebphoneCountryLabel() { - return webphoneCountryLabel; - } - - public void setWebphoneCountryLabel(String webphoneCountryLabel) { - this.webphoneCountryLabel = webphoneCountryLabel; - } - - public int compareTo(Object obj){ - String c1 = getCountry(); - String c2 = ((LuCountry)obj).getCountry(); - - return c1.compareTo(c2); - } - - - private String abbr; - private String country; - private String fullName; - private String webphoneCountryLabel; - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuState.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuState.java deleted file mode 100644 index 09d25b28..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuState.java +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - - -import org.openecomp.portalsdk.core.domain.support.*; - - -/** - *

State.java

- * - *

Represents a state data object.

- * - * @version 1.0 - */ -public class LuState extends DomainVo { - - /** - * - */ - private static final long serialVersionUID = 1L; - - LuState() {} - - public String getState() { - return state; - } - - public String getAbbr() { - return abbr; - } - - public void setState(String state) { - this.state = state; - } - - public void setAbbr(String abbr) { - this.abbr = abbr; - } - - - public int compareTo(Object obj){ - String c1 = getState(); - String c2 = ((LuState)obj).getState(); - - return c1.compareTo(c2); - } - - - private String abbr; - private String state; - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuTimeZone.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuTimeZone.java deleted file mode 100644 index bc0d9326..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/LuTimeZone.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - - -import org.openecomp.portalsdk.core.domain.support.*; - - -/** - *

LuTimeZone.java

- * - *

Represents a LuTimeZone data object.

- * - * @version 1.0 - */ -public class LuTimeZone extends DomainVo { - - /** - * - */ - private static final long serialVersionUID = 1L; - - LuTimeZone() {} - - public String getName() { - return name; - } - - public String getValue() { - return value; - } - - public void setName(String name) { - this.name = name; - } - - public void setValue(String value) { - this.value = value; - } - - - public Long getTimezoneId() { - return timezoneId; - } - - public void setTimezoneId(Long timezoneId) { - this.timezoneId = timezoneId; - } - - public int compareTo(Object obj){ - Long c1 = getId(); - Long c2 = ((LuTimeZone)obj).getId(); - - return c1.compareTo(c2); - } - - - private String name; - private Long timezoneId; - private String value; - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Menu.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Menu.java deleted file mode 100644 index 471edf86..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Menu.java +++ /dev/null @@ -1,160 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - - -import org.openecomp.portalsdk.core.domain.support.DomainVo; - -public class Menu extends DomainVo { - - /** - * - */ - private static final long serialVersionUID = 1L; - public Menu() {} - - public String getAction() { - return action; - } - - public boolean isActive() { - return active; - } - - public String getExternalUrl() { - return externalUrl; - } - - public String getFunctionCd() { - return functionCd; - } - - public String getLabel() { - return label; - } - - public String getMenuLevel() { - return menuLevel; - } - - public Long getParentId() { - return parentId; - } - - public String getQueryString() { - return queryString; - } - - public String getServlet() { - return servlet; - } - - public Short getSortOrder() { - return sortOrder; - } - - public String getTarget() { - return target; - } - - public String getMenuSetCode() { - return menuSetCode; - } - - public void setAction(String action) { - this.action = action; - } - - public void setActive(boolean active) { - this.active = active; - } - - public void setExternalUrl(String externalUrl) { - this.externalUrl = externalUrl; - } - - public void setFunctionCd(String functionCd) { - this.functionCd = functionCd; - } - - public void setLabel(String label) { - this.label = label; - } - - public void setMenuLevel(String menuLevel) { - this.menuLevel = menuLevel; - } - - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - public void setQueryString(String queryString) { - this.queryString = queryString; - } - - public void setServlet(String servlet) { - this.servlet = servlet; - } - - public void setSortOrder(Short sortOrder) { - this.sortOrder = sortOrder; - } - - public void setTarget(String target) { - this.target = target; - } - - public void setMenuSetCode(String menuSetCode) { - this.menuSetCode = menuSetCode; - } - - public boolean isSeparator() { - return separator; - } - - public void setSeparator(boolean separator) { - this.separator = separator; - } - - public String getImageSrc() { - return imageSrc; - } - - public void setImageSrc(String imageSrc) { - this.imageSrc = imageSrc; - } - - private String menuLevel; - private String label; - private Long parentId; - private String action; - private String functionCd; - private Short sortOrder; - private String servlet; - private String queryString; - private String externalUrl; - private String target; - private boolean active; - private String menuSetCode; - private boolean separator; - private String imageSrc; - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/MenuData.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/MenuData.java deleted file mode 100644 index c1cefb0b..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/MenuData.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - -import java.util.*; - -public class MenuData extends Menu { - - /** - * - */ - private static final long serialVersionUID = 1L; - private MenuData parentMenu; - private Set childMenus = new TreeSet(); - - public MenuData() {} - - public Set getChildMenus() { - return childMenus; - } - - public MenuData getParentMenu() { - return parentMenu; - } - - public void setChildMenus(Set childMenus) { - this.childMenus = childMenus; - } - - public void setParentMenu(MenuData parentMenu) { - this.parentMenu = parentMenu; - } - - public int compareTo(Object obj){ - - Short c1 = getSortOrder(); - Short c2 = ((MenuData)obj).getSortOrder(); - - return (c1 == null || c2 == null) ? 1 : ((c1.compareTo(c2) == 0) ? 1 : c1.compareTo(c2)); - } - - public String getActiveAsString(){ - return String.valueOf(isActive()); - } - - public String getParentIdAsString(){ - return String.valueOf(getParentId()); - } - - public String getSeparatorAsString(){ - return String.valueOf(isSeparator()); - } - - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Profile.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Profile.java deleted file mode 100644 index b5592021..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Profile.java +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; -import org.openecomp.portalsdk.core.domain.support.DomainVo; - -public class Profile extends DomainVo{ - - private static final long serialVersionUID = 3409056457412656883L; - - private Long id; - private String first_name; - private String last_name; - private String email; - private String orgManagerUserId; - private String active_yn; - private String orgUserId; - public Profile() {} - - - public Long getId() { - return id; - } - - - public void setId(Long id) { - this.id = id; - } - - - public String getFirst_name() { - return first_name; - } - - public void setFirst_name(String first_name) { - this.first_name = first_name; - } - - public String getLast_name() { - return last_name; - } - - public void setLast_name(String last_name) { - this.last_name = last_name; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getOrgManagerUserId() { - return orgManagerUserId; - } - - public void setOrgManagerUserId(String orgManagerUserId) { - this.orgManagerUserId = orgManagerUserId; - } - - public String getActive_yn() { - return active_yn; - } - - public void setActive_yn(String active_yn) { - this.active_yn = active_yn; - } - - public String getOrgUserId() { - return orgUserId; - } - - public void setOrgUserId(String orgUserId) { - this.orgUserId = orgUserId; - } - - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Role.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Role.java deleted file mode 100644 index cc9f0f8a..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/Role.java +++ /dev/null @@ -1,174 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - - -import java.util.Iterator; -import java.util.Set; -import java.util.TreeSet; - -import org.openecomp.portalsdk.core.domain.support.DomainVo; - -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** - *

Role.java

- *

Represents a role data object.

- * - * @version 1.0 - */ -public class Role extends DomainVo { - - /** - * - */ - private static final long serialVersionUID = 1L; - private String name; - private boolean active; - private Integer priority; - - private Set roleFunctions = new TreeSet(); - - private Set childRoles = new TreeSet(); - @JsonIgnore - private Set parentRoles = new TreeSet(); - - public Role() {} - - public String getName() { - return name; - } - - public boolean getActive() { - return active; - } - - public Set getRoleFunctions() { - return roleFunctions; - } - - public Integer getPriority() { - return priority; - } - - public Set getChildRoles() { - return childRoles; - } - - public Set getParentRoles() { - return parentRoles; - } - - public void setName(String name) { - this.name = name; - } - - public void setActive(boolean active) { - this.active = active; - } - - public void setRoleFunctions(Set roleFunctions) { - this.roleFunctions = roleFunctions; - } - - public void setPriority(Integer priority) { - this.priority = priority; - } - - - public void setChildRoles(Set childRoles) { - this.childRoles = childRoles; - } - - public void setParentRoles(Set parentRoles) { - this.parentRoles = parentRoles; - } - - @SuppressWarnings("unchecked") - public void addRoleFunction(RoleFunction roleFunction) { - this.roleFunctions.add(roleFunction); - } - - @SuppressWarnings("unchecked") - public void addChildRole(Role role) { - this.childRoles.add(role); - } - - @SuppressWarnings("unchecked") - public void addParentRole(Role role) { - this.parentRoles.add(role); - } - - public String getEditUrl() { - return "/role.htm?role_id=" + getId(); - } - - public String getToggleActiveImage() { - return "/static/fusion/images/" + (getActive() ? "active.png" : "inactive.png" ); - } - - public String getToggleActiveAltText() { - return getActive() ? "Click to Deactivate Role" : "Click to Activate Role"; - } - - public void removeChildRole(Long roleId) { - Iterator i = this.childRoles.iterator(); - - while (i.hasNext()) { - Role childRole = (Role)i.next(); - if (childRole.getId().equals(roleId)) { - this.childRoles.remove(childRole); - break; - } - } - } - - public void removeParentRole(Long roleId) { - Iterator i = this.parentRoles.iterator(); - - while (i.hasNext()) { - Role parentRole = (Role)i.next(); - if (parentRole.getId().equals(roleId)) { - this.parentRoles.remove(parentRole); - break; - } - } - } - - public void removeRoleFunction(String roleFunctionCd) { - Iterator i = this.roleFunctions.iterator(); - - while (i.hasNext()) { - RoleFunction roleFunction = (RoleFunction)i.next(); - if (roleFunction.getCode().equals(roleFunctionCd)) { - this.roleFunctions.remove(roleFunction); - break; - } - } - } - - public int compareTo(Object obj){ - String c1 = getName(); - String c2 = ((Role)obj).getName(); - - return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2); - } - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/RoleFunction.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/RoleFunction.java deleted file mode 100644 index 9fee520f..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/RoleFunction.java +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - - -import org.openecomp.portalsdk.core.domain.support.DomainVo; - -/** - *

RoleFunction.java

- * - *

Represents a role function data object.

- * - * @version 1.0 - */ -public class RoleFunction extends DomainVo { - - /** - * - */ - private static final long serialVersionUID = 1L; - public RoleFunction() {} - - public String getName() { - return name; - } - - public String getCode() { - return code; - } - - public void setName(String name) { - this.name = name; - } - - public void setCode(String code) { - this.code = code; - } - - public String getEditUrl() { - return "/role_function.htm?role_function_id=" + getCode(); - } - - public int compareTo(Object obj){ - String c1 = getName(); - String c2 = ((RoleFunction)obj).getName(); - - return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2); - } - - private String code; - private String name; - private String editUrl; - -} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/UrlsAccessible.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/UrlsAccessible.java deleted file mode 100644 index e0f35db0..00000000 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/UrlsAccessible.java +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ================================================================================ - */ -package org.openecomp.portalsdk.core.domain; - -import java.io.Serializable; - -public class UrlsAccessible extends FusionVo implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; - private UrlsAccessibleKey urlsAccessibleKey = new UrlsAccessibleKey(); - - public UrlsAccessible() {} - - public UrlsAccessible(String url, String functionCd) { - this(); - setUrl(url); - setFunctionCd(functionCd); - } - - public String getUrl() { - return getUrlsAccessibleKey().getUrl(); - } - - public String getFunctionCd() { - return getUrlsAccessibleKey().getFunctionCd(); - } - - public void setUrl(String url) { - getUrlsAccessibleKey().setUrl(url); - } - - public void setFunctionCd(String functionCd) { - getUrlsAccessibleKey().setFunctionCd(functionCd); - } - - public UrlsAccessibleKey getUrlsAccessibleKey() { - return urlsAccessibleKey; - } - - public void setUrlsAccessibleKey(UrlsAccessibleKey urlsAccessibleKey) { - this.urlsAccessibleKey = urlsAccessibleKey; - } - - // required by ZK for to set the selectedItems of Listboxes (used heavily for