From f8a8d5192b1e5013d9e2f699be54b072ef39d5f0 Mon Sep 17 00:00:00 2001 From: talasila Date: Wed, 8 Feb 2017 10:13:29 -0500 Subject: Initial OpenECOMP UI/DMaapBC commit Change-Id: Ia492e1b88311b9bed4c31f593b28deaaad73b7e4 Signed-off-by: talasila --- .../src/main/resources/att-rules.drl | 16 + dcae_dmaapbc_webapp/src/main/resources/cache.ccf | 30 ++ dcae_dmaapbc_webapp/src/main/resources/logback.xml | 350 +++++++++++++++++++++ .../src/main/resources/mchange-log.properties | 4 + .../src/main/resources/portal.properties | 50 +++ .../src/main/resources/state-rules.drl | 38 +++ 6 files changed, 488 insertions(+) create mode 100644 dcae_dmaapbc_webapp/src/main/resources/att-rules.drl create mode 100644 dcae_dmaapbc_webapp/src/main/resources/cache.ccf create mode 100644 dcae_dmaapbc_webapp/src/main/resources/logback.xml create mode 100644 dcae_dmaapbc_webapp/src/main/resources/mchange-log.properties create mode 100644 dcae_dmaapbc_webapp/src/main/resources/portal.properties create mode 100644 dcae_dmaapbc_webapp/src/main/resources/state-rules.drl (limited to 'dcae_dmaapbc_webapp/src/main/resources') diff --git a/dcae_dmaapbc_webapp/src/main/resources/att-rules.drl b/dcae_dmaapbc_webapp/src/main/resources/att-rules.drl new file mode 100644 index 0000000..e15c3fb --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/resources/att-rules.drl @@ -0,0 +1,16 @@ +package org.openecomp.portalsdk.core.drools; + + +rule "Drools NJ" +when +$droolsRuleService : DroolsRuleServiceImpl( state == "NJ" ) +then +$droolsRuleService.setResultsString("NJ state :" + " Garden State"); +end + +rule "Drools NY" +when +$droolsRuleService : DroolsRuleServiceImpl( state == "NY" ) +then +$droolsRuleService.setResultsString("NY state :" + " Empire State"); +end diff --git a/dcae_dmaapbc_webapp/src/main/resources/cache.ccf b/dcae_dmaapbc_webapp/src/main/resources/cache.ccf new file mode 100644 index 0000000..d21404b --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/resources/cache.ccf @@ -0,0 +1,30 @@ +# DEFAULT CACHE REGION +jcs.default=DC +jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.default.cacheattributes.MaxObjects=1000 +jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache +jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +jcs.default.elementattributes.IsEternal=true +jcs.default.elementattributes.IsSpool=true + + +# MEMORY SHRINKING CONFIGURATION (Commented) +#jcs.default.cacheattributes.UseMemoryShrinker=true +#jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 +#jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 +#jcs.default.cacheattributes.MaxSpoolPerRun=500 +#jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes +#jcs.default.elementattributes.IsEternal=false + + +# AUXILLARY CACHE CONFIGURATION +jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC.attributes.DiskPath=/tmp + + +# PRE-DEFINED REGION FOR LOOKUP DATA +jcs.region.lookUpObjectCache=DC +jcs.region.lookUpObjectCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes +jcs.region.lookUpObjectCache.cacheattributes.MaxObjects=4000 +jcs.region.lookUpObjectCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache diff --git a/dcae_dmaapbc_webapp/src/main/resources/logback.xml b/dcae_dmaapbc_webapp/src/main/resources/logback.xml new file mode 100644 index 0000000..65746ed --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/resources/logback.xml @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${defaultLoggerPattern} + + + + + + + + + + + + ${logDirectory}/${generalLogName}.log + + + ${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.log.zip + + + 30 + 3GB + + + + ${applicationLoggerPattern} + + + + + + 256 + + true + + + + + + + + + + + + + + + + + + + ${logDirectory}/${auditLogName}.log + + + ${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.log.zip + + + 30 + 3GB + + + + ${auditLoggerPattern} + + + + 256 + + + + + ${logDirectory}/${metricsLogName}.log + + + ${logDirectory}/${metricsLogName}.%d{yyyy-MM-dd}.log.zip + + + 30 + 3GB + + + + ${metricsLoggerPattern} + + + + + + 256 + + + + + ${logDirectory}/${errorLogName}.log + + + ${logDirectory}/${errorLogName}.%d{yyyy-MM-dd}.log.zip + + + 30 + 3GB + + + + ${errorLoggerPattern} + + + + + 256 + + + + + ${debugLogDirectory}/${debugLogName}.log + + + ${logDirectory}/${debugLogName}.%d{yyyy-MM-dd}.log.zip + + + 30 + 3GB + + + + ${defaultLoggerPattern} + + + + + 256 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dcae_dmaapbc_webapp/src/main/resources/mchange-log.properties b/dcae_dmaapbc_webapp/src/main/resources/mchange-log.properties new file mode 100644 index 0000000..ce1fa5f --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/resources/mchange-log.properties @@ -0,0 +1,4 @@ +# Direct the proprietary logger used by com.mchange.c3p0 to use slf4j + +com.mchange.v2.log.MLog=com.mchange.v2.log.FallbackMLog +com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=OFF diff --git a/dcae_dmaapbc_webapp/src/main/resources/portal.properties b/dcae_dmaapbc_webapp/src/main/resources/portal.properties new file mode 100644 index 0000000..c5ae309 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/resources/portal.properties @@ -0,0 +1,50 @@ +# Properties read by ECOMP Framework library, ecompFW.jar + +########################################################################## +# The following properties should NOT be changed by partner applications. +########################################################################## + +portal.api.prefix = /api +max.idle.time = 5 +user.attribute.name = user_attribute + +testing=testing + +#Use REST API instead of UEB to fetch the functional menu data +use_rest_for_functional_menu=true + +########################################################################## +# The following properties MUST be changed by partner applications. +########################################################################## + +# Name of java class that implements the OnBoardingApiService interface. +portal.api.impl.class = org.openecomp.portalsdk.core.onboarding.client.OnBoardingApiServiceImpl + +# CSP Global Log On for single sign on +ecomp_redirect_url = http://todo_enter_portal_hostname:8080/ecompportal/login.htm + +# URL of the ECOMP Portal REST API + +ecomp_rest_url = TODO_Portal_URL + +# Applications do not need to run a UEB listener in 1610. +ueb_listeners_enable = false + +# UEB Configuration +# In release 1607, all 6 entries below were required. +# In release 1610, if key ueb_listeners_enable is set to false, +# then only the ueb_app_key is required. +# UEB servers +ueb_url_list = todo_ueb_url_list +# ECOMP Portal listens on this UEB topic +ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST-DEMETER +# Replace these 3 default values with the ones for your specific App, +# as shown on the on-boarding page on the ECOMP Portal web application. +ueb_app_key = ZOicEniw7BWDL1pM +ueb_app_secret = PJIsBErHfo2RGKzuu03CZKgV +ueb_app_mailbox_name = ECOMP-PORTAL-OUTBOX-TEST-32756 +# Consumer group name for UEB topic. +# Use the special tag '{UUID}' to generate a unique one for each sdk-app server. +ueb_app_consumer_group_name = {UUID} + +decryption_key = AGLDdG4D04BKm2IxIWEr8o== \ No newline at end of file diff --git a/dcae_dmaapbc_webapp/src/main/resources/state-rules.drl b/dcae_dmaapbc_webapp/src/main/resources/state-rules.drl new file mode 100644 index 0000000..586ae6b --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/resources/state-rules.drl @@ -0,0 +1,38 @@ +package org.openecomp.portalsdk.core.drools; +global String age + +rule "Default" +when +$droolsRuleService : DroolsRuleServiceImpl( state != null ) +then +System.out.println($droolsRuleService.accessLabel() +" "+ $droolsRuleService.getState() +" state legal age is " + getDefaultIfNull(age)); +$droolsRuleService.setResultsString($droolsRuleService.getState()+" state legal age is " + getDefaultIfNull(age)); +end + +rule "Drools NJ" +when +$droolsRuleService : DroolsRuleServiceImpl( state == "NJ" ) +then +System.out.println($droolsRuleService.accessLabel() +" "+ "NJ state legal age is " + getDefaultIfNull(age)); +$droolsRuleService.setResultsString("NJ state legal age is " + getDefaultIfNull(age)); +end + +rule "Drools KY" +when +$droolsRuleService : DroolsRuleServiceImpl( state == "KY" ) +then +System.out.println($droolsRuleService.accessLabel() +" "+ "KY state legal age is " + getDefaultIfNull("20")); +$droolsRuleService.setResultsString("KY state legal age is " + getDefaultIfNull("20")); +end + +rule "Drools NY" +when +$droolsRuleService : DroolsRuleServiceImpl( state == "NY" ) +then +System.out.println($droolsRuleService.accessLabel() +" "+ "NY state legal age is " + getDefaultIfNull("21")); +$droolsRuleService.setResultsString("NY state legal age is " + getDefaultIfNull("21")); +end + +function String getDefaultIfNull(String age) { +return age == null ? "18" : age; +} \ No newline at end of file -- cgit 1.2.3-korg