[Policy-52, Policy-92, Policy-93] Policy Enhancements and bugfixes

Change-Id: I5675cf4527e17963b3142cf7184c0df31a766197
Signed-off-by: Tarun Tej Velaga <tt3868@att.com>
diff --git a/packages/base/src/files/install/elk/config/elasticsearch.yml b/packages/base/src/files/install/elk/config/elasticsearch.yml
index d9e8868..b890bb1 100644
--- a/packages/base/src/files/install/elk/config/elasticsearch.yml
+++ b/packages/base/src/files/install/elk/config/elasticsearch.yml
@@ -55,6 +55,7 @@
 # Set the bind address to a specific IP (IPv4 or IPv6):
 #
 #network.host: 192.168.0.1
+network.host: ["${{ELK_NETWORK_HOST}}", "127.0.0.1"]
 #
 # Set a custom port for HTTP:
 #
@@ -87,4 +88,4 @@
 #
 # Require explicit names when deleting indices:
 #
-#action.destructive_requires_name: true
+#action.destructive_requires_name: true
\ No newline at end of file
diff --git a/packages/base/src/files/install/servers/brmsgw/dependency.json b/packages/base/src/files/install/servers/brmsgw/dependency.json
index c3d3f1d..9c25c74 100644
--- a/packages/base/src/files/install/servers/brmsgw/dependency.json
+++ b/packages/base/src/files/install/servers/brmsgw/dependency.json
@@ -6,7 +6,7 @@
 			"version": "${{BRMS_DEPENDENCY_VERSION}}"
 		}, {
 			"groupId": "org.onap.policy.drools-applications",
-			"artifactId": "controlloop",
+			"artifactId": "events",
 			"version": "${{BRMS_DEPENDENCY_VERSION}}"
 		}, {
 			"groupId": "org.onap.policy.drools-applications",
diff --git a/packages/base/src/files/install/servers/pap/bin/pip.properties b/packages/base/src/files/install/servers/pap/bin/pip.properties
index 79839af..d9df903 100644
--- a/packages/base/src/files/install/servers/pap/bin/pip.properties
+++ b/packages/base/src/files/install/servers/pap/bin/pip.properties
@@ -1,227 +1,15 @@
 #
 # Default PIP Configuration from Policy. 
 # 
-xacml.pip.engines=AAF,sql1
+xacml.pip.engines=AAF,historydb
 
 ### AAF PIP Configuration. 
 AAF.description=AAFEngine to communicate with AAF to take decisions
 AAF.classname=org.openecomp.policy.xacml.std.pip.engines.aaf.AAFEngine
 AAF.name=AAFEngine
 
-### sql1 PIP Configuration. 
-# Class from XACML resource. 
-sql1.classname=com.att.research.xacml.std.pip.engines.jdbc.JDBCEngine
-sql1.name=OperationsHistory
-sql1.description=Database of operations performed via closed loop.
-sql1.issuer=org:openecomp:xacml:sql123
-sql1.type=jdbc
-# Configurable Values. 
-sql1.jdbc.driver=${{JDBC_DRIVER}}
-sql1.jdbc.url=${{JDBC_URL}}
-sql1.jdbc.conn.user=${{JDBC_USER}}
-sql1.jdbc.conn.password=${{JDBC_PASSWORD}}
-
-#Each of the following resolvers corresponds to a specific time window. The only difference between them is the "interval" in the "select" SQL query and the "issuer".
-sql1.resolvers=tw5min,tw10min,tw30min,tw1h,tw12h,tw1d,tw5d,tw1w,tw1mon
-
-##############################################
-sql1.resolver.tw5min.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 5 minute) and now()
-sql1.resolver.tw5min.field.count.issuer=org:openecomp:xacml:sql:tw5min
-
-sql1.resolver.tw5min.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw5min.name=OperationsCount
-sql1.resolver.tw5min.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw5min.fields=count
-sql1.resolver.tw5min.field.count.id=count
-sql1.resolver.tw5min.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw5min.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw5min.parameters=actor,operation,target
-sql1.resolver.tw5min.parameter.actor.id=actor
-sql1.resolver.tw5min.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw5min.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw5min.parameter.operation.id=recipe
-sql1.resolver.tw5min.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw5min.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw5min.parameter.target.id=target
-sql1.resolver.tw5min.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw5min.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-##############################################
-sql1.resolver.tw10min.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 10 minute) and now()
-sql1.resolver.tw10min.field.count.issuer=org:openecomp:xacml:sql:tw10min
-
-sql1.resolver.tw10min.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw10min.name=OperationsCount
-sql1.resolver.tw10min.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw10min.fields=count
-sql1.resolver.tw10min.field.count.id=count
-sql1.resolver.tw10min.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw10min.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw10min.parameters=actor,operation,target
-sql1.resolver.tw10min.parameter.actor.id=actor
-sql1.resolver.tw10min.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw10min.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw10min.parameter.operation.id=recipe
-sql1.resolver.tw10min.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw10min.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw10min.parameter.target.id=target
-sql1.resolver.tw10min.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw10min.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-##############################################
-sql1.resolver.tw30min.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 30 minute) and now()
-sql1.resolver.tw30min.field.count.issuer=org:openecomp:xacml:sql:tw30min
-
-sql1.resolver.tw30min.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw30min.name=OperationsCount
-sql1.resolver.tw30min.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw30min.fields=count
-sql1.resolver.tw30min.field.count.id=count
-sql1.resolver.tw30min.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw30min.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw30min.parameters=actor,operation,target
-sql1.resolver.tw30min.parameter.actor.id=actor
-sql1.resolver.tw30min.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw30min.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw30min.parameter.operation.id=recipe
-sql1.resolver.tw30min.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw30min.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw30min.parameter.target.id=target
-sql1.resolver.tw30min.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw30min.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-##############################################
-sql1.resolver.tw1h.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 1 hour) and now()
-sql1.resolver.tw1h.field.count.issuer=org:openecomp:xacml:sql:tw1h
-
-sql1.resolver.tw1h.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw1h.name=OperationsCount
-sql1.resolver.tw1h.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw1h.fields=count
-sql1.resolver.tw1h.field.count.id=count
-sql1.resolver.tw1h.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw1h.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1h.parameters=actor,operation,target
-sql1.resolver.tw1h.parameter.actor.id=actor
-sql1.resolver.tw1h.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1h.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1h.parameter.operation.id=recipe
-sql1.resolver.tw1h.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1h.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1h.parameter.target.id=target
-sql1.resolver.tw1h.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1h.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-
-##############################################
-sql1.resolver.tw12h.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 12 hour) and now()
-sql1.resolver.tw12h.field.count.issuer=org:openecomp:xacml:sql:tw12h
-
-sql1.resolver.tw12h.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw12h.name=OperationsCount
-sql1.resolver.tw12h.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw12h.fields=count
-sql1.resolver.tw12h.field.count.id=count
-sql1.resolver.tw12h.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw12h.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw12h.parameters=actor,operation,target
-sql1.resolver.tw12h.parameter.actor.id=actor
-sql1.resolver.tw12h.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw12h.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw12h.parameter.operation.id=recipe
-sql1.resolver.tw12h.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw12h.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw12h.parameter.target.id=target
-sql1.resolver.tw12h.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw12h.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-
-#############################
-sql1.resolver.tw1d.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 1 day) and now()
-sql1.resolver.tw1d.field.count.issuer=org:openecomp:xacml:sql:tw1d
-
-sql1.resolver.tw1d.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw1d.name=OperationsCount
-sql1.resolver.tw1d.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw1d.fields=count
-sql1.resolver.tw1d.field.count.id=count
-sql1.resolver.tw1d.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw1d.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1d.parameters=actor,operation,target
-sql1.resolver.tw1d.parameter.actor.id=actor
-sql1.resolver.tw1d.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1d.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1d.parameter.operation.id=recipe
-sql1.resolver.tw1d.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1d.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1d.parameter.target.id=target
-sql1.resolver.tw1d.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1d.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-
-#############################
-sql1.resolver.tw5d.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 5 day) and now()
-sql1.resolver.tw5d.field.count.issuer=org:openecomp:xacml:sql:tw5d
-
-sql1.resolver.tw5d.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw5d.name=OperationsCount
-sql1.resolver.tw5d.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw5d.fields=count
-sql1.resolver.tw5d.field.count.id=count
-sql1.resolver.tw5d.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw5d.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw5d.parameters=actor,operation,target
-sql1.resolver.tw5d.parameter.actor.id=actor
-sql1.resolver.tw5d.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw5d.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw5d.parameter.operation.id=recipe
-sql1.resolver.tw5d.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw5d.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw5d.parameter.target.id=target
-sql1.resolver.tw5d.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw5d.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-
-#############################
-sql1.resolver.tw1w.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 1 week) and now()
-sql1.resolver.tw1w.field.count.issuer=org:openecomp:xacml:sql:tw1w
-
-sql1.resolver.tw1w.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw1w.name=OperationsCount
-sql1.resolver.tw1w.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw1w.fields=count
-sql1.resolver.tw1w.field.count.id=count
-sql1.resolver.tw1w.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw1w.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1w.parameters=actor,operation,target
-sql1.resolver.tw1w.parameter.actor.id=actor
-sql1.resolver.tw1w.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1w.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1w.parameter.operation.id=recipe
-sql1.resolver.tw1w.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1w.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1w.parameter.target.id=target
-sql1.resolver.tw1w.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1w.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-
-#############################
-sql1.resolver.tw1mon.select=select count(*) as count from operationshistory10 where outcome<>'Failure_Guard' and actor=? and operation=? and target=? and endtime between date_sub(now(),interval 1 month) and now()
-sql1.resolver.tw1mon.field.count.issuer=org:openecomp:xacml:sql:tw1mon
-
-sql1.resolver.tw1mon.classname=com.att.research.xacml.std.pip.engines.jdbc.ConfigurableJDBCResolver
-sql1.resolver.tw1mon.name=OperationsCount
-sql1.resolver.tw1mon.description=This returns the number of previous operations within the given time window
-sql1.resolver.tw1mon.fields=count
-sql1.resolver.tw1mon.field.count.id=count
-sql1.resolver.tw1mon.field.count.datatype=http://www.w3.org/2001/XMLSchema#integer
-sql1.resolver.tw1mon.field.count.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1mon.parameters=actor,operation,target
-sql1.resolver.tw1mon.parameter.actor.id=actor
-sql1.resolver.tw1mon.parameter.actor.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1mon.parameter.actor.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1mon.parameter.operation.id=recipe
-sql1.resolver.tw1mon.parameter.operation.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1mon.parameter.operation.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
-sql1.resolver.tw1mon.parameter.target.id=target
-sql1.resolver.tw1mon.parameter.target.datatype=http://www.w3.org/2001/XMLSchema#string
-sql1.resolver.tw1mon.parameter.target.category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource
+# PIP Engine Definition
+#
+historydb.classname=org.openecomp.policy.xacml.std.pip.engines.OperationHistoryEngine
+historydb.issuer=org:onap:xacml:guard:historydb
+historydb.name=operationHistoryDB
\ No newline at end of file
diff --git a/packages/base/src/files/install/servers/pdp/bin/xacml.pdp.properties b/packages/base/src/files/install/servers/pdp/bin/xacml.pdp.properties
index 7750047..7653963 100644
--- a/packages/base/src/files/install/servers/pdp/bin/xacml.pdp.properties
+++ b/packages/base/src/files/install/servers/pdp/bin/xacml.pdp.properties
@@ -138,3 +138,6 @@
 #Required only, when we use AAF
 policy.aaf.namespace = ${{POLICY_AAF_NAMESPACE}}
 policy.aaf.resource = ${{POLICY_AAF_RESOURCE}}
+# Decision Response settings. 
+# can be either PERMIT or DENY. 
+decision.indeterminate.response=${{DECISION_INDETERMINATE_RESPONSE}}
diff --git a/packages/install/src/files/pdp.conf b/packages/install/src/files/pdp.conf
index 95c1300..fbdfade 100644
--- a/packages/install/src/files/pdp.conf
+++ b/packages/install/src/files/pdp.conf
@@ -32,3 +32,4 @@
 resource_name=pdp_1
 dependency_groups=pdplp_1;brmsgw_1
 
+DECISION_INDETERMINATE_RESPONSE=DENY
\ No newline at end of file