Guard policy Backend

Introduce Guard policy backend code

Issue-ID: CLAMP-190
Change-Id: I7d60c6dd700c84607329f5449287465379b94807
Signed-off-by: sebdet <sd378r@intl.att.com>
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties
index fe7eabc..0ce8a7b 100644
--- a/src/main/resources/application-noaaf.properties
+++ b/src/main/resources/application-noaaf.properties
@@ -197,12 +197,12 @@
 #DCAE Inventory Url Properties
 clamp.config.dcae.inventory.url=http://dcae.api.simpledemo.onap.org:8080
 clamp.config.dcae.intentory.retry.interval=10000
-clamp.config.dcae.intentory.retry.limit=3
+clamp.config.dcae.intentory.retry.limit=5
 
 #DCAE Dispatcher Url Properties
 clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188
-clamp.config.dcae.dispatcher.retry.interval=10000
-clamp.config.dcae.dispatcher.retry.limit=10
+clamp.config.dcae.dispatcher.retry.interval=20000
+clamp.config.dcae.dispatcher.retry.limit=30
 clamp.config.dcae.header.requestId = X-ECOMP-RequestID
 
 #Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 9e2e3c9..cdbe613 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -177,7 +177,7 @@
 #
 # Operational Policy request build properties
 #
-clamp.config.op.policyDescription=from clds
+clamp.config.op.policyDescription=from CLAMP
 # default
 clamp.config.op.templateName=ClosedLoopControlName
 clamp.config.op.operationTopic=APPC-CL
@@ -214,12 +214,12 @@
 #DCAE Inventory Url Properties
 clamp.config.dcae.inventory.url=http://dcae.api.simpledemo.onap.org:8080
 clamp.config.dcae.intentory.retry.interval=10000
-clamp.config.dcae.intentory.retry.limit=3
+clamp.config.dcae.intentory.retry.limit=5
 
 #DCAE Dispatcher Url Properties
 clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188
-clamp.config.dcae.dispatcher.retry.interval=10000
-clamp.config.dcae.dispatcher.retry.limit=10
+clamp.config.dcae.dispatcher.retry.interval=20000
+clamp.config.dcae.dispatcher.retry.limit=30
 clamp.config.dcae.header.requestId = X-ECOMP-RequestID
 
 #Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index 8305c2e..c7f7ec3 100644
--- a/src/main/resources/clds/camel/routes/flexible-flow.xml
+++ b/src/main/resources/clds/camel/routes/flexible-flow.xml
@@ -10,6 +10,7 @@
 										<constant>30000</constant>
 								</delay>
 								<to uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
 						</when>
 						<when>
@@ -22,6 +23,7 @@
 								</delay>
 								<to
 										uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'UPDATE'</simple>
@@ -31,16 +33,19 @@
 										<constant>30000</constant>
 								</delay>
 								<to uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'STOP'</simple>
 								<to
 										uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'RESTART'</simple>
+								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
 						</when>
diff --git a/src/main/resources/clds/templates/globalProperties.json b/src/main/resources/clds/templates/globalProperties.json
index 880b992..b6f68f6 100644
--- a/src/main/resources/clds/templates/globalProperties.json
+++ b/src/main/resources/clds/templates/globalProperties.json
@@ -78,7 +78,22 @@
 			"Failure_Exception": "Failure: Exception",
 			"Failure": "Failure: Other",
 			"Success": "Success"
-		}
+		},
+		"guardTargets": ".*",
+		"minGuard":1,
+		"maxGuard":1,
+		"limitGuard":1,
+		"timeUnitsGuard":{
+			"minute":"minute",
+			"hour":"hour",
+			"day":"day",
+			"week":"week",
+			"month":"month",
+			"year":"year"
+		},
+		"timeWindowGuard":10,
+		"guardActiveStart":"00:00:01-05:00",
+		"guardActiveEnd":"00:00:00-05:00"
 	},
 	"shared": {
 		"byService": {