summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/base/src/files/install/mysql/data/151000_downgrade_script.sql75
-rw-r--r--packages/base/src/files/install/mysql/data/151000_upgrade_script.sql1563
-rw-r--r--packages/base/src/files/install/mysql/data/151001_downgrade_script.sql248
-rw-r--r--packages/base/src/files/install/mysql/data/151001_upgrade_script.sql246
-rw-r--r--packages/base/src/files/install/mysql/data/151002_downgrade_script.sql21
-rw-r--r--packages/base/src/files/install/mysql/data/151002_upgrade_script.sql21
-rw-r--r--packages/base/src/files/install/mysql/data/151200_downgrade_script.sql43
-rw-r--r--packages/base/src/files/install/mysql/data/151200_upgrade_script.sql226
-rw-r--r--packages/base/src/files/install/mysql/data/160200_downgrade_script.sql39
-rw-r--r--packages/base/src/files/install/mysql/data/160200_upgrade_script.sql127
-rw-r--r--packages/base/src/files/install/mysql/data/160201_downgrade_script.sql43
-rw-r--r--packages/base/src/files/install/mysql/data/160201_upgrade_script.sql44
-rw-r--r--packages/base/src/files/install/mysql/data/160400_downgrade_script.sql33
-rw-r--r--packages/base/src/files/install/mysql/data/160400_upgrade_script.sql124
-rw-r--r--packages/install/pom.xml6
-rw-r--r--policy-core/pom.xml97
-rw-r--r--policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java32
-rw-r--r--policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java141
-rw-r--r--policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySessionFeatureAPI.java (renamed from policy-core/src/main/java/org/openecomp/policy/drools/core/FeatureAPI.java)65
-rw-r--r--policy-core/src/main/java/org/openecomp/policy/drools/properties/PolicyProperties.java17
-rw-r--r--policy-endpoints/pom.xml6
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/TopicListener.java7
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSinkFactory.java205
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java235
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSinkFactory.java38
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSourceFactory.java36
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusConsumer.java268
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusPublisher.java229
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusTopicBase.java45
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineBusTopicSink.java6
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineDmaapTopicSink.java85
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineUebTopicSink.java11
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java10
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java117
-rw-r--r--policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedUebTopicSource.java13
-rw-r--r--policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java2
-rw-r--r--policy-healthcheck/pom.xml50
-rw-r--r--policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java146
-rw-r--r--policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI (renamed from policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI)0
-rw-r--r--policy-management/pom.xml8
-rw-r--r--policy-management/src/main/java/org/openecomp/policy/drools/controller/internal/MavenDroolsController.java13
-rw-r--r--policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyControllerFeatureAPI.java41
-rw-r--r--policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyEngineFeatureAPI.java164
-rw-r--r--policy-management/src/main/java/org/openecomp/policy/drools/system/PolicyEngine.java297
-rw-r--r--policy-management/src/main/java/org/openecomp/policy/drools/system/internal/AggregatedPolicyController.java11
-rw-r--r--policy-management/src/main/server/config/IntegrityMonitor.properties18
-rw-r--r--policy-management/src/main/server/config/logback.xml2
-rw-r--r--policy-persistence/pom.xml59
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/core/DroolsPDPIntegrityMonitor.java160
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorRestManager.java91
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java57
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java442
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/JpaDroolsPdpsConnector.java17
-rw-r--r--policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/PersistenceFeature.java171
-rw-r--r--policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.PolicySessionFeatureAPI (renamed from policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI)0
-rw-r--r--policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI1
-rw-r--r--policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/ResiliencyTestCases.java1267
-rw-r--r--policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java497
-rw-r--r--policy-persistence/src/test/resources/IntegrityMonitor.properties6
-rw-r--r--policy-persistence/src/test/resources/META-INF/persistence.xml2
-rw-r--r--policy-persistence/src/test/server/config/IntegrityMonitor.properties7
-rw-r--r--policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java33
-rw-r--r--pom.xml109
63 files changed, 3103 insertions, 5090 deletions
diff --git a/packages/base/src/files/install/mysql/data/151000_downgrade_script.sql b/packages/base/src/files/install/mysql/data/151000_downgrade_script.sql
deleted file mode 100644
index d336c5c0..00000000
--- a/packages/base/src/files/install/mysql/data/151000_downgrade_script.sql
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-use xacml;
-
-DROP TABLE IF EXISTS XACML.SYSTEMLOGDB;
-DROP TABLE IF EXISTS XACML.SEQUENCE;
-DROP TABLE IF EXISTS XACML.RULEALGORITHMS;
-DROP TABLE IF EXISTS XACML.ROLES;
-DROP TABLE IF EXISTS XACML.POLICYALGORITHMS;
-DROP TABLE IF EXISTS XACML.POLICY_MANANGEMENT;
-DROP TABLE IF EXISTS XACML.PIPRESOLVERPARAMS;
-DROP TABLE IF EXISTS XACML.PIPRESOLVER;
-DROP TABLE IF EXISTS XACML.PIPCONFIGPARAMS;
-DROP TABLE IF EXISTS XACML.PIPCONFIGURATION;
-DROP TABLE IF EXISTS XACML.PIPTYPE;
-DROP TABLE IF EXISTS XACML.OBADVICEEXPRESSIONS;
-DROP TABLE IF EXISTS XACML.GLOBALROLESETTINGS;
-DROP TABLE IF EXISTS XACML.FUNCTIONARGUMENTS;
-DROP TABLE IF EXISTS XACML.FUNCTIONDEFINITION;
-DROP TABLE IF EXISTS XACML.ECOMPNAME;
-DROP TABLE IF EXISTS XACML.DECISIONSETTINGS;
-DROP TABLE IF EXISTS XACML.ATTRIBUTEASSIGNMENT;
-DROP TABLE IF EXISTS XACML.CONSTRAINTVALUES;
-DROP TABLE IF EXISTS XACML.ATTRIBUTE;
-DROP TABLE IF EXISTS XACML.OBADVICE;
-DROP TABLE IF EXISTS XACML.CONSTRAINTTYPE;
-DROP TABLE IF EXISTS XACML.CATEGORY;
-DROP TABLE IF EXISTS XACML.DATATYPE;
-DROP TABLE IF EXISTS XACML.ACTIONPOLICYDICT;
-DROP TABLE IF EXISTS XACML.SERVICEGROUP;
-DROP TABLE IF EXISTS XACML.SECURITYZONE;
-DROP TABLE IF EXISTS XACML.POLICYENTITY;
-DROP TABLE IF EXISTS XACML.CONFIGURATIONDATAENTITY;
-DROP TABLE IF EXISTS XACML.POLICYDBDAOENTITY;
-
-DROP TABLE IF EXISTS XACML.POLICYSCORE;
-DROP TABLE IF EXISTS XACML.ACTIONLIST;
-DROP TABLE IF EXISTS XACML.PROTOCOLLIST;
-DROP TABLE IF EXISTS XACML.TERM;
-DROP TABLE IF EXISTS XACML.PREFIXLIST;
-DROP TABLE IF EXISTS XACML.SCOPE;
-DROP TABLE IF EXISTS XACML.ENFORCINGTYPE;
-DROP TABLE IF EXISTS XACML.PORTLIST;
-DROP TABLE IF EXISTS XACML.GROUPSERVICELIST;
-DROP TABLE IF EXISTS XACML.VSCLACTION;
-DROP TABLE IF EXISTS XACML.VNFTYPE;
-DROP TABLE IF EXISTS XACML.ADDRESSGROUP;
-
--- DROP SEQUENCE IF EXISTS XACML.SEQCONFIG;
--- DROP SEQUENCE IF EXISTS XACML.SEQPOLICY;
-
-DROP TABLE IF EXISTS LOG.SEQUENCE;
-DROP TABLE IF EXISTS LOG.SYSTEMLOGDB;
-
-DROP VIEW IF EXISTS xacml.match_functions;
-DROP VIEW IF EXISTS xacml.xacml.function_flattener;
-DROP VIEW IF EXISTS xacml.xacml.higherorder_bag_functions;
diff --git a/packages/base/src/files/install/mysql/data/151000_upgrade_script.sql b/packages/base/src/files/install/mysql/data/151000_upgrade_script.sql
deleted file mode 100644
index 065d705f..00000000
--- a/packages/base/src/files/install/mysql/data/151000_upgrade_script.sql
+++ /dev/null
@@ -1,1563 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-use xacml;
-
-DROP TABLE IF EXISTS XACML.SYSTEMLOGDB;
-DROP TABLE IF EXISTS XACML.SEQUENCE;
-DROP TABLE IF EXISTS XACML.RULEALGORITHMS;
-DROP TABLE IF EXISTS XACML.ROLES;
-DROP TABLE IF EXISTS XACML.POLICYALGORITHMS;
-DROP TABLE IF EXISTS XACML.POLICY_MANANGEMENT;
-DROP TABLE IF EXISTS XACML.PIPRESOLVERPARAMS;
-DROP TABLE IF EXISTS XACML.PIPRESOLVER;
-DROP TABLE IF EXISTS XACML.PIPCONFIGPARAMS;
-DROP TABLE IF EXISTS XACML.PIPCONFIGURATION;
-DROP TABLE IF EXISTS XACML.PIPTYPE;
-DROP TABLE IF EXISTS XACML.OBADVICEEXPRESSIONS;
-DROP TABLE IF EXISTS XACML.GLOBALROLESETTINGS;
-DROP TABLE IF EXISTS XACML.FUNCTIONARGUMENTS;
-DROP TABLE IF EXISTS XACML.FUNCTIONDEFINITION;
-DROP TABLE IF EXISTS XACML.ECOMPNAME;
-DROP TABLE IF EXISTS XACML.DECISIONSETTINGS;
-DROP TABLE IF EXISTS XACML.ATTRIBUTEASSIGNMENT;
-DROP TABLE IF EXISTS XACML.CONSTRAINTVALUES;
-DROP TABLE IF EXISTS XACML.ATTRIBUTE;
-DROP TABLE IF EXISTS XACML.OBADVICE;
-DROP TABLE IF EXISTS XACML.CONSTRAINTTYPE;
-DROP TABLE IF EXISTS XACML.CATEGORY;
-DROP TABLE IF EXISTS XACML.DATATYPE;
-DROP TABLE IF EXISTS XACML.ACTIONPOLICYDICT;
-DROP TABLE IF EXISTS XACML.SERVICEGROUP;
-DROP TABLE IF EXISTS XACML.SECURITYZONE;
-DROP TABLE IF EXISTS XACML.VSCLACTION;
-DROP TABLE IF EXISTS XACML.VNFTYPE;
-DROP TABLE IF EXISTS XACML.POLICYENTITY;
-DROP TABLE IF EXISTS XACML.CONFIGURATIONDATAENTITY;
-DROP TABLE IF EXISTS XACML.PolicyDBDaoEntity;
-
-DROP TABLE IF EXISTS XACML.POLICYSCORE;
-DROP TABLE IF EXISTS XACML.ACTIONLIST;
-DROP TABLE IF EXISTS XACML.PROTOCOLLIST;
-DROP TABLE IF EXISTS XACML.TERM;
-DROP TABLE IF EXISTS XACML.PREFIXLIST;
-DROP TABLE IF EXISTS XACML.SCOPE;
-DROP TABLE IF EXISTS XACML.GROUPSERVICELIST;
-DROP TABLE IF EXISTS XACML.ENFORCINGTYPE;
-DROP TABLE IF EXISTS XACML.PORTLIST;
-DROP TABLE IF EXISTS XACML.ADDRESSGROUP;
-
--- DROP SEQUENCE IF EXISTS XACML.SEQCONFIG;
--- DROP SEQUENCE IF EXISTS XACML.SEQPOLICY;
-DROP TABLE IF EXISTS LOG.SEQUENCE;
-DROP TABLE IF EXISTS LOG.SYSTEMLOGDB;
-
-DROP VIEW IF EXISTS xacml.match_functions;
-DROP VIEW IF EXISTS xacml.function_flattener;
-DROP VIEW IF EXISTS xacml.higherorder_bag_functions;
-
-DROP TABLE IF EXISTS XACML.GroupServiceList;
-
-CREATE TABLE XACML.GroupServiceList
-(
-id INTEGER NOT NULL,
-name varchar(32),
-serviceList varchar(255),
-PRIMARY KEY (id)
-)
-;
-CREATE INDEX IDX_GROUPSERVICELIST ON XACML.GROUPSERVICELIst(ID);
-
-DROP TABLE IF EXISTS XACML.PolicyAlgorithms;
-
-CREATE TABLE XACML.PolicyAlgorithms
-(
-id INTEGER NOT NULL,
- is_standard CHAR NOT NULL,
- short_name VARCHAR(64) NOT NULL,
- xacml_id VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.AttributeAssignment;
-
-CREATE TABLE XACML.AttributeAssignment
-(
-id INTEGER NOT NULL,
- attribute_id INTEGER,
- expression VARCHAR(5000) NOT NULL,
- OBADVICE_id INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.roles;
-CREATE TABLE XACML.roles
-(
-id INTEGER NOT NULL,
- attuid VARCHAR(45) NOT NULL,
- role VARCHAR(45) NOT NULL,
- scope VARCHAR(45),
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.POLICYSCORE;
-CREATE TABLE XACML.POLICYSCORE
-(
-POLICY_NAME VARCHAR(200) NOT NULL,
- POLICY_SCORE VARCHAR(100),
- PRIMARY KEY (POLICY_NAME)
-)
-;
-
-DROP TABLE IF EXISTS XACML.GlobalRoleSettings;
-CREATE TABLE XACML.GlobalRoleSettings
-(
-role VARCHAR(45) NOT NULL,
- lockdown BOOLEAN,
- PRIMARY KEY (role)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PIPResolverParams;
-CREATE TABLE XACML.PIPResolverParams
-(
-id INTEGER NOT NULL,
- PARAM_DEFAULT VARCHAR(2048),
- PARAM_NAME VARCHAR(1024) NOT NULL,
- PARAM_VALUE VARCHAR(2048) NOT NULL,
- REQUIRED CHAR NOT NULL,
- ID_RESOLVER INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.Attribute;
-CREATE TABLE XACML.Attribute
-(
-id INTEGER NOT NULL,
- ATTRIBUTE_VALUE VARCHAR(255),
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048),
- is_designator CHAR NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- PRIORITY VARCHAR(45),
- selector_path VARCHAR(2048),
- xacml_id VARCHAR(100) NOT NULL UNIQUE,
- category INTEGER,
- constraint_type INTEGER,
- datatype INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.FunctionArguments;
-CREATE TABLE XACML.FunctionArguments
-(
-id INTEGER NOT NULL,
- arg_index INTEGER NOT NULL,
- is_bag INTEGER NOT NULL,
- datatype_id INTEGER,
- function_id INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.actionlist;
-CREATE TABLE XACML.actionlist
-(
-id INTEGER NOT NULL,
- actionname VARCHAR(45) NOT NULL,
- description VARCHAR(64),
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.Obadvice;
-CREATE TABLE XACML.Obadvice
-(
-id INTEGER NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP NOT NULL,
- description VARCHAR(2048),
- fulfill_on VARCHAR(32),
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- type VARCHAR(100) NOT NULL,
- xacml_id VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.ObadviceExpressions;
-CREATE TABLE XACML.ObadviceExpressions
-(
-id INTEGER NOT NULL,
- type VARCHAR(100) NOT NULL,
- obadvice_id INTEGER,
- attribute_id INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.RuleAlgorithms;
-CREATE TABLE XACML.RuleAlgorithms
-(
-id INTEGER NOT NULL,
- is_standard CHAR NOT NULL,
- short_name VARCHAR(64) NOT NULL,
- xacml_id VARCHAR(255) NOT NULL UNIQUE,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.ConstraintValues;
-CREATE TABLE XACML.ConstraintValues
-(
-id INTEGER NOT NULL,
- property VARCHAR(1000),
- value VARCHAR(1000),
- attribute_id INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.DecisionSettings;
-CREATE TABLE XACML.DecisionSettings
-(
-id INTEGER NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048),
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- PRIORITY VARCHAR(45),
- xacml_id VARCHAR(45) NOT NULL UNIQUE,
- datatype INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.policy_manangement;
-CREATE TABLE XACML.policy_manangement
-(
-id INTEGER NOT NULL,
- CONFIG_NAME VARCHAR(45) NOT NULL,
- CREATE_DATE_TIME TIMESTAMP NOT NULL,
- CREATED_BY VARCHAR(45) NOT NULL,
- ECOMP_NAME VARCHAR(45) NOT NULL,
- POLICY_NAME VARCHAR(45) NOT NULL,
- scope VARCHAR(45) NOT NULL,
- UPDATE_DATE_TIME TIMESTAMP NOT NULL,
- UPDATED_BY VARCHAR(45) NOT NULL,
- XML text NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PIPConfiguration;
-CREATE TABLE XACML.PIPConfiguration
-(
-id INTEGER NOT NULL,
- CLASSNAME VARCHAR(2048) NOT NULL,
- CREATED_BY VARCHAR(255) NOT NULL,
- CREATED_DATE TIMESTAMP NOT NULL,
- DESCRIPTION VARCHAR(2048),
- ISSUER VARCHAR(1024),
- MODIFIED_BY VARCHAR(255) NOT NULL,
- MODIFIED_DATE TIMESTAMP NOT NULL,
- NAME VARCHAR(255) NOT NULL,
- READ_ONLY CHAR NOT NULL,
- REQUIRES_RESOLVER CHAR NOT NULL,
- TYPE INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.protocollist;
-CREATE TABLE XACML.protocollist
-(
-id INTEGER NOT NULL,
- description VARCHAR(64),
- protocolname VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-
-DROP TABLE IF EXISTS XACML.FunctionDefinition;
-CREATE TABLE XACML.FunctionDefinition
-(
-id INTEGER NOT NULL,
- arg_lb INTEGER NOT NULL,
- arg_ub INTEGER NOT NULL,
- ho_arg_lb INTEGER,
- ho_arg_ub INTEGER,
- ho_primitive CHAR,
- is_bag_return INTEGER NOT NULL,
- is_higher_order INTEGER NOT NULL,
- short_name VARCHAR(64) NOT NULL,
- xacml_id VARCHAR(255) NOT NULL,
- return_datatype INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PIPResolver;
-CREATE TABLE XACML.PIPResolver
-(
-id INTEGER NOT NULL,
- CLASSNAME VARCHAR(2048) NOT NULL,
- CREATED_BY VARCHAR(255) NOT NULL,
- CREATED_DATE TIMESTAMP NOT NULL,
- DESCRIPTION VARCHAR(2048),
- ISSUER VARCHAR(1024),
- MODIFIED_BY VARCHAR(255) NOT NULL,
- MODIFIED_DATE TIMESTAMP NOT NULL,
- NAME VARCHAR(255) NOT NULL,
- READ_ONLY CHAR NOT NULL,
- PIP_ID INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.TERM;
-CREATE TABLE XACML.TERM
-(
-id INTEGER NOT NULL,
- description VARCHAR(100),
- action VARCHAR(100),
- destIPList VARCHAR(100),
- destPortList VARCHAR(100),
- portList VARCHAR(100),
- protocolList VARCHAR(100),
- srcIPList VARCHAR(100),
- srcPortList VARCHAR(100),
- termName VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PREFIXLIST;
-CREATE TABLE XACML.PREFIXLIST
-(
-id INTEGER NOT NULL,
- pl_name VARCHAR(45) NOT NULL,
- pl_value VARCHAR(64) NOT NULL,
- description VARCHAR(255),
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.Datatype;
-CREATE TABLE XACML.Datatype
-(
-id INTEGER NOT NULL,
- is_standard CHAR NOT NULL,
- short_name VARCHAR(64) NOT NULL,
- xacml_id VARCHAR(255) NOT NULL UNIQUE,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PIPType;
-CREATE TABLE XACML.PIPType
-(
-id INTEGER NOT NULL,
- type VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.ActionPolicyDict;
-CREATE TABLE XACML.ActionPolicyDict
-(
-id INTEGER NOT NULL,
- ATTRIBUTE_NAME VARCHAR(45) NOT NULL,
- Body VARCHAR(4096),
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048),
- Headers VARCHAR(1024),
- Method VARCHAR(45) NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- Type VARCHAR(45) NOT NULL,
- URL VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.Category;
-CREATE TABLE XACML.Category
-(
-id INTEGER NOT NULL,
- grouping VARCHAR(64) NOT NULL,
- is_standard CHAR NOT NULL,
- short_name VARCHAR(64) NOT NULL,
- xacml_id VARCHAR(255) NOT NULL UNIQUE,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.Scope;
-CREATE TABLE XACML.Scope
-(
-scopeId BIGINT NOT NULL,
- parentScope BIGINT,
- scopeName VARCHAR(255) NOT NULL,
- PRIMARY KEY (scopeId)
-)
-;
-CREATE INDEX parentScope ON Scope (parentScope);
-
-DROP TABLE IF EXISTS XACML.EcompName;
-CREATE TABLE XACML.EcompName
-(
-id INTEGER NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048),
- ecomp_Name VARCHAR(100) NOT NULL UNIQUE,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.ConstraintType;
-CREATE TABLE XACML.ConstraintType
-(
-id INTEGER NOT NULL,
- constraint_type VARCHAR(64) NOT NULL,
- description VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.EnforcingType;
-CREATE TABLE XACML.EnforcingType
-(
-id INTEGER NOT NULL,
- connectionQuery VARCHAR(255) NOT NULL,
- enforcingType VARCHAR(255) NOT NULL UNIQUE,
- script VARCHAR(255) NOT NULL,
- valueQuery VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PIPConfigParams;
-CREATE TABLE XACML.PIPConfigParams
-(
-id INTEGER NOT NULL,
- PARAM_DEFAULT VARCHAR(2048),
- PARAM_NAME VARCHAR(1024) NOT NULL,
- PARAM_VALUE VARCHAR(2048) NOT NULL,
- REQUIRED CHAR NOT NULL,
- PIP_ID INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.portlist;
-CREATE TABLE XACML.portlist
-(
-id INTEGER NOT NULL,
- description VARCHAR(64),
- portname VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.SEQUENCE;
-CREATE TABLE XACML.SEQUENCE
-(
-SEQ_NAME VARCHAR(50) NOT NULL,
- SEQ_COUNT NUMERIC(38),
- PRIMARY KEY (SEQ_NAME)
-)
-;
--- INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN', 0);
--- CREATE SEQUENCE seq START WITH 1;
-
-DROP TABLE IF EXISTS XACML.SYSTEMLOGDB;
-CREATE TABLE XACML.SYSTEMLOGDB
-(
- id INTEGER NOT NULL AUTO_INCREMENT,
- system VARCHAR(255) NOT NULL,
- description VARCHAR(2048),
- remote VARCHAR(255) NOT NULL,
- type VARCHAR(10) NOT NULL,
- date TIMESTAMP NOT NULL,
- logtype VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-)
-
-;
-
-DROP TABLE IF EXISTS LOG.SEQUENCE;
-CREATE TABLE LOG.SEQUENCE
-(
-SEQ_NAME VARCHAR(50) NOT NULL,
- SEQ_COUNT NUMERIC(38),
- PRIMARY KEY (SEQ_NAME)
-)
-;
-
-DROP TABLE IF EXISTS LOG.SYSTEMLOGDB;
-CREATE TABLE LOG.SYSTEMLOGDB
-(
- id INTEGER NOT NULL AUTO_INCREMENT,
- system VARCHAR(255) NOT NULL,
- description VARCHAR(2048),
- remote VARCHAR(255) NOT NULL,
- type VARCHAR(10) NOT NULL,
- date TIMESTAMP NOT NULL,
- logtype VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-drop table if exists SUPPORT.DB_VERSION;
-create table SUPPORT.DB_VERSION
-(
- the_key varchar(20) primary key not null,
- version varchar(20)
-)
-;
-
-DROP TABLE IF EXISTS XACML.SERVICEGROUP;
-CREATE TABLE XACML.SERVICEGROUP
-(
-id integer NOT NULL,
-name varchar(32),
-type varchar(16),
-transportprotocol varchar(255),
-appprotocol varchar(255),
-ports varchar(255),
-`desc` varchar(255),
-primary key(id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.SECURITYZONE;
-CREATE TABLE XACML.SECURITYZONE
-(
-id integer NOT NULL,
-name varchar(32),
-value varchar(64),
-primary key(id)
-)
-;
-
-CREATE TABLE XACML.VSCLACTION
-(
-ID INTEGER NOT NULL,
-VSCL_ACTION VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-CREATE TABLE XACML.VNFTYPE
-(
-ID INTEGER NOT NULL,
-VNF_TYPE VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-)
-;
-
-DROP TABLE IF EXISTS XACML.POLICYENTITY;
-CREATE TABLE XACML.PolicyEntity
-(
-policyId BIGINT NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- deleted BOOLEAN NOT NULL,
- description VARCHAR(2048) NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- policyData TEXT,
- policyName VARCHAR(255) NOT NULL,
- scope VARCHAR(255) NOT NULL,
- version INTEGER,
- configurationDataId BIGINT,
- PRIMARY KEY (policyId))
-;
-CREATE INDEX scope ON XACML.PolicyEntity (scope);
-CREATE INDEX policyName ON XACML.PolicyEntity (policyName);
-
-DROP TABLE IF EXISTS XACML.ConfigurationDataEntity;
-CREATE TABLE XACML.ConfigurationDataEntity
-(
-configurationDataId BIGINT NOT NULL,
- configBody TEXT,
- configType VARCHAR(255) NOT NULL,
- configurationName VARCHAR(255) NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- deleted BOOLEAN NOT NULL,
- description VARCHAR(2048) NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- version INTEGER,
- PRIMARY KEY (configurationDataId))
-;
-
-DROP TABLE IF EXISTS XACML.PolicyDBDaoEntity;
-CREATE TABLE XACML.PolicyDBDaoEntity
-(
- policyDBDaoUrl VARCHAR(500) NOT NULL UNIQUE,
- created_date TIMESTAMP,
- description VARCHAR(2048) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- PRIMARY KEY (policyDBDaoUrl))
-;
-
-DROP TABLE IF EXISTS XACML.ADDRESSGROUP;
-CREATE TABLE ADDRESSGROUP
-(
- id INTEGER NOT NULL,
- name varchar(32),
- description VARCHAR(64),
- prefixlist varchar(255)
-);
-
-create index idx_addressgroup on ADDRESSGROUP(ID);
-
-
-
-create or replace view xacml.match_functions
-as select d.id as id, d.short_name as shortname, d.xacml_id as xacmlid,
-d.return_datatype as return_datatype, d.is_bag_return as is_bag_return,
-d.arg_lb as arg_lb, d.arg_ub as arg_ub, a1.is_bag as arg1_isbag,
-a1.datatype_id as arg1_datatype, a2.is_bag as arg2_isbag,
-a2.datatype_id as arg2_datatype
-from (xacml.functiondefinition d
-left join xacml.functionarguments a1 on (a1.function_id = d.id and a1.arg_index = 1)
-left join xacml.functionarguments a2 on (a2.function_id = d.id and a2.arg_index = 2))
-where (d.arg_lb = 2 and d.arg_ub = 2 and d.return_datatype = 18 and a1.is_bag = 0)
-order by d.short_name;
-
-create or replace view xacml.function_flattener
-as select d.id as id, d.short_name as shortname,
-d.return_datatype as return_datatype, d.is_bag_return as is_bag_return,
-d.is_higher_order as is_higher_order, d.arg_lb as arg_lb, d.arg_ub as arg_ub,
-a1.is_bag as arg1_isbag, a1.datatype_id as arg1_datatype, a2.is_bag as arg2_isbag,
-a2.datatype_id as arg2_datatype, a3.is_bag as arg3_isbag,
-a3.datatype_id as arg3_datatype
-from (xacml.functiondefinition d left join xacml.functionarguments a1
-on (a1.function_id = d.id and a1.arg_index = 1)
-left join xacml.functionarguments a2 on (a2.function_id = d.id and a2.arg_index = 2)
-left join xacml.functionarguments a3 on (a3.function_id = d.id and a3.arg_index = 3))
-order by d.id;
-
-create or replace view xacml.higherorder_bag_functions
-as select * from xacml.function_flattener
-where is_higher_order = 1 and is_bag_return = 1 and return_datatype=18
-and arg_lb=2 and arg_ub=2 and arg1_isbag = 1 and (arg2_isbag = 1 or arg2_isbag is null);
-
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.SYSTEMLOGDB TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.SEQUENCE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.RULEALGORITHMS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ROLES TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.POLICYALGORITHMS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.POLICY_MANANGEMENT TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PIPRESOLVERPARAMS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PIPRESOLVER TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PIPCONFIGPARAMS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PIPCONFIGURATION TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PIPTYPE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.OBADVICEEXPRESSIONS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.GLOBALROLESETTINGS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.FUNCTIONARGUMENTS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.FUNCTIONDEFINITION TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ECOMPNAME TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.DECISIONSETTINGS TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ATTRIBUTEASSIGNMENT TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.CONSTRAINTVALUES TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ATTRIBUTE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.OBADVICE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.CONSTRAINTTYPE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.CATEGORY TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.DATATYPE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ACTIONPOLICYDICT TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.POLICYENTITY TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.CONFIGURATIONDATAENTITY TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PolicyDBDaoEntity TO policy_user;
-
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.POLICYSCORE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ACTIONLIST TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PROTOCOLLIST TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.TERM TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PREFIXLIST TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.SCOPE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ENFORCINGTYPE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.PORTLIST TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.GROUPSERVICELIST TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.VSCLACTION TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.VNFTYPE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON XACML.ADDRESSGROUP TO policy_user;
-
-GRANT SELECT, INSERT, UPDATE, DELETE ON LOG.SEQUENCE TO policy_user;
-GRANT SELECT, INSERT, UPDATE, DELETE ON LOG.SYSTEMLOGDB TO policy_user;
-
-grant insert, update, delete, select on support.db_version to policy_user;
-grant select on xacml.match_functions to policy_user;
-grant select on xacml.function_flattener to policy_user;
-grant select on xacml.higherorder_bag_functions to policy_user;
-
-
-
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1401,'super-admin',str_to_date('2015-05-11 19:56:54.930000','%Y-%m-%d %H:%i:%s.%f'),null,'1','super-admin',str_to_date('2015-05-11 19:56:54.930000','%Y-%m-%d %H:%i:%s.%f'),null,'true',5,null,18,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1455,'super-admin',str_to_date('2015-05-13 14:10:44.134000','%Y-%m-%d %H:%i:%s.%f'),null,'1','super-admin',str_to_date('2015-05-13 14:10:44.134000','%Y-%m-%d %H:%i:%s.%f'),null,'Test-Kat',5,null,26,'High',null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1551,'super-admin',str_to_date('2015-05-22 11:40:23.118000','%Y-%m-%d %H:%i:%s.%f'),null,'1','super-admin',str_to_date('2015-05-22 11:40:23.118000','%Y-%m-%d %H:%i:%s.%f'),null,'test',5,null,26,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1926,'super-admin',str_to_date('2015-06-09 11:42:16.580000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window starts (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:29:46.407000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Thursday_Start:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1927,'super-admin',str_to_date('2015-06-09 11:42:33.966000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window starts (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:29:24.841000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Friday_Start:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1928,'super-admin',str_to_date('2015-06-09 11:42:49.867000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window starts (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:29:32.730000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Saturday_Start:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1929,'super-admin',str_to_date('2015-06-09 11:43:11.486000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window starts (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:34:08.866000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Sunday_Start:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1954,'super-admin',str_to_date('2015-06-11 23:30:12.656000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window ends (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:30:39.869000','%Y-%m-%d %H:%i:%s.%f'),null,'Window _Monday_End:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1955,'super-admin',str_to_date('2015-06-11 23:30:46.701000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window ends (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:32:01.698000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Friday_End:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1956,'super-admin',str_to_date('2015-06-11 23:31:10.449000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window ends (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:31:42.361000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Saturday_End:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1957,'super-admin',str_to_date('2015-06-11 23:32:25.542000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window ends (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:32:45.215000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Sunday_End:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1958,'super-admin',str_to_date('2015-06-11 23:32:55.89000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window ends (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:33:11.766000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Thursday_End:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1959,'super-admin',str_to_date('2015-06-11 23:33:28.664000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window ends (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:33:47.905000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Tuesday_End:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (1960,'super-admin',str_to_date('2015-06-11 23:34:18.912000','%Y-%m-%d %H:%i:%s.%f'),'Hour when maintenance window ends (0 to 24)','1','super-admin',str_to_date('2015-06-11 23:35:12.283000','%Y-%m-%d %H:%i:%s.%f'),null,'Window_Wednesday_End:',5,null,12,null,null);
-INSERT INTO XACML.ATTRIBUTE (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,IS_DESIGNATOR,MODIFIED_BY,MODIFIED_DATE,SELECTOR_PATH,XACML_ID,CATEGORY,CONSTRAINT_TYPE,DATATYPE,PRIORITY,ATTRIBUTE_VALUE) VALUES (2904,'super-admin',str_to_date('2015-08-24 18:06:29.370000','%Y-%m-%d %H:%i:%s.%f'),'Test','1','super-admin',str_to_date('2015-08-24 18:06:29.370000','%Y-%m-%d %H:%i:%s.%f'),null,'KK1:(0)',5,null,26,null,null);
-
-
-
-
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (4,'subject','S','intermediary-subject','urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject');
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (5,'resource','S','resource','urn:oasis:names:tc:xacml:3.0:attribute-category:resource');
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (6,'subject','S','codebase','urn:oasis:names:tc:xacml:1.0:subject-category:codebase');
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (7,'action','S','action','urn:oasis:names:tc:xacml:3.0:attribute-category:action');
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (8,'subject','S','access-subject','urn:oasis:names:tc:xacml:1.0:subject-category:access-subject');
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (9,'environment','S','environment','urn:oasis:names:tc:xacml:3.0:attribute-category:environment');
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (10,'subject','S','requesting-machine','urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine');
-INSERT INTO XACML.CATEGORY (ID,GROUPING,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (11,'subject','S','recipient-subject','urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject');
-
-
-INSERT INTO XACML.CONSTRAINTTYPE (ID,CONSTRAINT_TYPE,DESCRIPTION) VALUES (1,'Range','Set a range of min and/or max integer/double values the attribute can be set to during policy creation.');
-INSERT INTO XACML.CONSTRAINTTYPE (ID,CONSTRAINT_TYPE,DESCRIPTION) VALUES (2,'Regular Expression','Define a regular expression the attribute must match against during policy creation.');
-INSERT INTO XACML.CONSTRAINTTYPE (ID,CONSTRAINT_TYPE,DESCRIPTION) VALUES (3,'Enumeration','Enumerate a set of values that the attribute may be set to during policy creation.');
-
-
-
-
-
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (12,'S','integer','http://www.w3.org/2001/XMLSchema#integer');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (13,'S','base64Binary','http://www.w3.org/2001/XMLSchema#base64Binary');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (14,'S','x500Name','urn:oasis:names:tc:xacml:1.0:data-type:x500Name');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (15,'S','dayTimeDuration','http://www.w3.org/2001/XMLSchema#dayTimeDuration');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (16,'S','time','http://www.w3.org/2001/XMLSchema#time');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (17,'S','dnsName','urn:oasis:names:tc:xacml:2.0:data-type:dnsName');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (18,'S','boolean','http://www.w3.org/2001/XMLSchema#boolean');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (19,'S','dateTime','http://www.w3.org/2001/XMLSchema#dateTime');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (20,'S','rfc822Name','urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (21,'S','date','http://www.w3.org/2001/XMLSchema#date');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (22,'S','ipAddress','urn:oasis:names:tc:xacml:2.0:data-type:ipAddress');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (23,'S','yearMonthDuration','http://www.w3.org/2001/XMLSchema#yearMonthDuration');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (24,'S','hexBinary','http://www.w3.org/2001/XMLSchema#hexBinary');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (25,'S','double','http://www.w3.org/2001/XMLSchema#double');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (26,'S','string','http://www.w3.org/2001/XMLSchema#string');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (27,'S','anyURI','http://www.w3.org/2001/XMLSchema#anyURI');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (28,'S','xpathExpression','urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression');
-INSERT INTO XACML.DATATYPE (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (29,'S','user','');
-
-
-
-
-INSERT INTO XACML.ECOMPNAME (ID,CREATED_BY,CREATED_DATE,DESCRIPTION,ECOMP_NAME,MODIFIED_BY,MODIFIED_DATE) VALUES (1456,'super-admin',str_to_date('2015-05-13 14:21:34.778000','%Y-%m-%d %H:%i:%s.%f'),'orchestrator','MSO','super-admin',str_to_date('2015-05-13 14:21:34.778000','%Y-%m-%d %H:%i:%s.%f'));
-
-
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (1,1,0,12,1);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (2,2,0,12,1);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (3,1,0,12,2);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (4,2,0,12,2);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (5,1,0,25,3);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (6,1,1,12,4);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (7,1,1,25,5);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (8,1,0,26,6);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (9,2,0,26,6);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (10,1,0,26,7);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (11,2,0,26,7);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (12,1,0,26,8);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (13,2,0,26,8);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (14,1,0,26,9);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (15,2,0,26,9);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (16,1,0,26,10);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (17,1,0,26,11);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (18,1,0,18,12);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (19,1,0,26,13);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (20,1,0,12,14);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (21,1,0,26,15);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (22,1,0,25,16);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (23,1,0,26,17);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (24,1,0,16,18);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (25,1,0,26,19);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (26,1,0,21,20);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (27,1,0,26,21);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (28,1,0,19,22);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (29,1,0,26,23);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (30,1,0,27,24);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (31,1,0,26,25);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (32,1,0,15,26);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (33,1,0,26,27);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (34,1,0,23,28);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (35,1,0,26,29);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (36,1,0,14,30);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (37,1,0,26,31);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (38,1,0,20,32);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (39,1,0,26,33);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (40,1,0,22,34);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (41,1,0,26,35);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (42,1,0,17,36);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (43,2,0,27,37);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (44,1,0,26,37);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (45,1,0,26,38);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (46,2,0,27,38);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (47,1,0,26,39);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (48,2,0,26,39);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (49,1,0,26,40);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (50,2,0,27,40);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (51,1,0,26,41);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (52,2,0,12,41);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (53,3,0,12,41);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (54,1,0,27,42);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (55,2,0,12,42);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (56,3,0,12,42);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (57,1,0,18,43);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (58,2,0,18,43);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (59,1,0,12,44);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (60,2,0,12,44);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (61,1,0,25,45);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (62,2,0,25,45);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (63,1,0,21,46);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (64,2,0,21,46);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (65,1,0,16,47);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (66,2,0,16,47);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (67,1,0,19,48);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (68,2,0,19,48);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (69,1,0,15,49);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (70,2,0,15,49);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (71,1,0,23,50);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (72,2,0,23,50);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (73,1,0,27,51);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (74,2,0,27,51);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (75,1,0,14,52);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (76,2,0,14,52);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (77,1,0,20,53);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (78,2,0,20,53);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (79,1,0,24,54);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (80,2,0,24,54);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (81,1,0,13,55);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (82,2,0,13,55);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (83,1,0,12,56);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (84,2,0,12,56);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (85,1,0,25,57);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (86,2,0,25,57);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (89,1,0,25,58);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (90,2,0,25,58);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (91,1,0,12,59);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (92,2,0,12,59);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (93,1,0,25,60);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (94,2,0,25,60);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (95,1,0,12,61);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (96,2,0,12,61);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (97,1,0,25,62);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (98,2,0,25,62);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (99,1,0,12,63);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (100,2,0,12,63);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (101,1,0,12,64);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (102,1,0,25,65);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (103,1,0,25,66);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (104,1,0,25,67);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (125,1,0,26,68);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (126,1,0,26,69);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (128,1,0,12,70);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (129,1,0,12,71);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (130,2,0,12,71);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (131,1,0,12,72);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (132,2,0,12,72);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (133,1,0,12,73);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (134,2,0,12,73);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (135,1,0,25,74);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (136,2,0,25,74);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (137,1,0,25,75);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (138,2,0,25,75);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (139,1,0,25,76);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (140,2,0,25,76);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (141,1,0,25,77);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (142,2,0,25,77);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (143,1,0,19,78);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (144,2,0,15,78);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (145,1,0,19,79);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (146,2,0,23,79);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (147,1,0,19,80);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (148,2,0,15,80);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (149,1,0,19,81);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (150,2,0,23,81);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (151,1,0,21,82);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (152,2,0,23,82);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (153,1,0,21,83);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (154,2,0,23,83);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (155,1,0,26,84);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (156,2,0,26,84);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (157,1,0,26,85);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (158,2,0,26,85);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (159,1,0,26,86);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (160,2,0,26,86);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (161,1,0,26,87);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (162,2,0,26,87);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (163,1,0,16,88);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (164,2,0,16,88);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (165,1,0,16,89);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (166,2,0,16,89);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (167,1,0,16,90);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (168,2,0,16,90);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (169,1,0,16,91);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (170,2,0,16,91);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (171,1,0,16,92);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (172,2,0,16,92);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (173,1,0,19,93);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (174,2,0,19,93);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (175,1,0,19,94);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (176,2,0,19,94);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (177,1,0,19,95);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (178,2,0,19,95);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (179,1,0,19,96);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (180,2,0,19,96);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (181,1,0,21,97);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (182,2,0,21,97);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (183,1,0,21,98);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (184,2,0,21,98);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (185,2,0,21,99);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (186,1,0,21,99);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (187,2,0,21,100);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (188,1,0,21,100);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (189,1,1,26,101);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (190,1,1,26,102);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (191,1,0,26,103);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (192,2,1,26,103);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (193,1,0,26,104);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (194,1,1,12,105);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (195,1,0,12,106);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (196,2,1,12,106);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (197,1,0,12,107);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (198,1,1,25,108);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (199,1,0,25,109);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (200,2,1,25,109);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (201,1,0,25,110);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (202,1,1,18,111);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (203,1,1,18,112);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (204,1,0,18,113);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (205,2,1,18,113);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (206,1,0,18,114);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (207,1,1,16,115);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (208,1,1,16,116);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (209,1,0,16,117);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (210,2,1,16,117);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (211,1,0,16,118);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (212,1,1,21,119);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (213,1,1,21,120);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (214,1,0,21,121);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (215,2,1,21,121);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (216,1,0,21,122);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (217,1,1,19,123);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (218,1,1,19,124);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (219,1,0,19,125);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (220,2,1,19,125);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (221,1,0,19,126);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (222,1,1,27,127);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (223,1,1,27,128);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (224,1,0,27,129);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (225,2,1,27,129);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (226,1,0,27,130);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (227,1,1,24,131);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (228,1,1,24,132);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (229,1,0,24,133);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (230,2,1,24,133);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (231,1,0,24,134);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (232,1,1,13,135);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (233,1,1,13,136);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (234,1,0,13,137);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (235,2,1,13,137);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (236,1,0,13,138);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (237,1,1,15,139);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (238,1,1,15,140);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (239,1,0,15,141);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (240,2,1,15,141);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (241,1,0,15,142);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (242,1,1,23,143);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (243,1,1,23,144);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (244,2,1,23,145);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (245,1,0,23,145);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (246,1,0,23,146);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (247,1,1,14,147);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (248,1,1,14,148);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (249,1,0,14,149);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (250,2,1,14,149);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (251,1,0,14,150);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (252,1,1,20,151);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (253,1,1,20,152);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (254,1,0,20,153);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (255,2,1,20,153);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (256,1,0,20,154);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (257,1,1,22,155);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (258,1,1,22,156);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (259,1,0,22,157);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (260,2,1,22,157);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (261,1,0,22,158);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (262,1,1,17,159);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (263,1,1,17,160);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (264,1,0,17,161);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (265,2,1,17,161);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (266,1,0,17,162);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (267,1,0,26,163);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (268,2,0,26,163);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (269,1,0,26,164);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (270,2,0,27,164);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (271,1,0,26,165);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (272,2,0,22,165);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (273,1,0,26,166);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (274,2,0,17,166);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (275,1,0,26,167);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (276,2,0,20,167);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (277,1,0,26,168);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (278,2,0,14,168);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (279,1,1,26,169);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (280,2,1,26,169);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (281,1,1,26,170);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (282,2,1,26,170);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (283,1,1,26,171);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (284,1,1,26,172);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (285,2,1,26,172);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (286,1,1,26,173);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (287,2,1,26,173);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (288,2,1,12,174);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (289,1,1,12,174);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (290,1,1,12,175);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (292,2,1,12,176);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (293,1,1,12,176);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (294,2,1,12,177);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (295,1,1,12,177);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (296,1,1,25,178);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (297,2,1,25,178);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (298,1,1,25,179);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (299,1,1,25,180);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (300,2,1,25,180);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (301,1,1,25,181);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (302,2,1,25,181);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (303,1,1,18,182);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (304,2,1,18,182);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (305,1,1,18,183);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (306,2,1,18,183);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (307,1,1,18,184);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (308,1,1,18,185);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (309,2,1,18,185);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (310,1,1,18,186);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (311,2,1,18,186);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (312,2,1,16,187);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (313,1,1,16,187);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (314,1,1,16,188);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (315,2,1,16,188);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (316,1,1,16,189);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (317,1,1,16,190);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (318,2,1,16,190);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (319,1,1,16,191);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (320,2,1,16,191);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (321,1,1,21,192);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (322,2,1,21,192);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (323,1,1,21,193);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (324,2,1,21,193);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (325,1,1,21,194);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (326,1,1,21,195);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (327,2,1,21,195);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (328,1,1,21,196);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (329,2,1,21,196);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (330,1,1,19,197);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (331,2,1,19,197);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (332,1,1,19,198);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (333,2,1,19,198);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (334,1,1,19,199);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (335,1,1,19,200);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (336,2,1,19,200);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (337,1,1,19,201);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (338,2,1,19,201);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (339,1,1,27,202);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (340,2,1,27,202);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (341,1,1,27,203);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (342,2,1,27,203);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (343,1,1,27,204);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (344,1,1,27,205);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (345,2,1,27,205);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (346,1,1,27,206);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (347,2,1,27,206);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (348,1,1,24,207);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (349,2,1,24,207);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (350,1,1,24,208);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (351,2,1,24,208);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (352,1,1,24,209);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (353,1,1,24,210);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (354,2,1,24,210);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (355,1,1,24,211);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (356,2,1,24,211);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (357,1,1,13,212);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (358,2,1,13,212);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (359,1,1,13,213);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (360,2,1,13,213);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (361,1,1,13,214);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (362,1,1,13,215);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (363,2,1,13,215);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (364,1,1,13,216);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (365,2,1,13,216);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (366,1,1,15,217);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (367,2,1,15,217);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (368,1,1,15,218);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (369,2,1,15,218);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (370,1,1,15,219);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (371,1,1,15,220);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (372,2,1,15,220);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (373,1,1,15,221);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (374,2,1,15,221);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (375,1,1,23,222);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (376,2,1,23,222);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (377,1,1,23,223);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (378,2,1,23,223);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (380,1,1,23,224);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (381,1,1,23,225);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (382,2,1,23,225);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (383,2,1,23,226);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (384,1,1,23,226);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (385,1,1,14,227);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (386,2,1,14,227);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (387,1,1,14,228);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (388,2,1,14,228);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (389,1,1,14,229);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (390,1,1,14,230);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (391,2,1,14,230);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (392,1,1,14,231);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (393,2,1,14,231);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (394,1,1,20,232);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (395,2,1,20,232);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (396,1,1,20,233);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (397,2,1,20,233);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (398,1,1,20,234);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (399,1,1,20,235);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (400,2,1,20,235);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (401,1,1,20,236);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (402,2,1,20,236);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (403,1,0,14,237);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (404,2,0,14,237);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (405,1,0,26,238);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (406,2,0,20,238);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (407,1,1,12,239);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (408,2,1,12,239);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (409,1,1,25,240);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (410,2,1,25,240);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (411,1,0,18,241);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (412,1,0,18,242);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (413,1,0,12,243);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (414,2,0,18,243);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (415,1,0,18,244);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (416,1,0,18,245);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (417,2,0,null,245);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (418,3,1,null,245);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (419,1,0,18,246);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (420,2,0,null,246);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (421,3,1,null,246);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (422,1,0,18,247);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (423,2,1,null,247);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (424,3,1,null,247);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (433,1,0,18,248);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (434,2,1,null,248);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (435,3,1,null,248);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (436,1,0,18,249);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (437,2,1,null,249);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (438,3,1,null,249);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (439,1,0,18,250);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (440,2,1,null,250);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (441,3,1,null,250);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (442,1,0,null,251);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (447,2,1,null,251);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (448,1,0,28,252);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (449,1,0,28,253);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (450,2,0,28,253);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (451,1,0,28,254);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (452,2,0,28,254);
-INSERT INTO XACML.FUNCTIONARGUMENTS (ID,ARG_INDEX,IS_BAG,DATATYPE_ID,FUNCTION_ID) VALUES (453,3,0,16,92);
-
-
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (1,2,2,null,null,null,0,0,'integer-greater-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (2,2,2,null,null,null,0,0,'integer-subtract','urn:oasis:names:tc:xacml:1.0:function:integer-subtract',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (3,1,1,null,null,null,0,0,'double-to-integer','urn:oasis:names:tc:xacml:1.0:function:double-to-integer',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (4,1,1,null,null,null,0,0,'integer-one-and-only','urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (5,1,1,null,null,null,0,0,'double-one-and-only','urn:oasis:names:tc:xacml:1.0:function:double-one-and-only',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (6,2,2,null,null,null,0,0,'string-equal','urn:oasis:names:tc:xacml:1.0:function:string-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (7,2,2,null,null,null,0,0,'string-equal-ignore-case','urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (8,2,2,null,null,null,0,0,'string-starts-with','urn:oasis:names:tc:xacml:3.0:function:string-starts-with',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (9,2,2,null,null,null,0,0,'string-ends-with','urn:oasis:names:tc:xacml:3.0:function: string-ends-with',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (10,2,-1,null,null,null,0,0,'string-concatenate','urn:oasis:names:tc:xacml:2.0:function:string-concatenate',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (11,1,1,null,null,null,0,0,'boolean-from-string','urn:oasis:names:tc:xacml:3.0:function:boolean-from-string',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (12,1,1,null,null,null,0,0,'string-from-boolean','urn:oasis:names:tc:xacml:3.0:function:string-from-boolean',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (13,1,1,null,null,null,0,0,'integer-from-string','urn:oasis:names:tc:xacml:3.0:function:integer-from-string',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (14,1,1,null,null,null,0,0,'string-from-integer','urn:oasis:names:tc:xacml:3.0:function:string-from-integer',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (15,1,1,null,null,null,0,0,'double-from-string','urn:oasis:names:tc:xacml:3.0:function:double-from-string',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (16,1,1,null,null,null,0,0,'string-from-double','urn:oasis:names:tc:xacml:3.0:function:string-from-double',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (17,1,1,null,null,null,0,0,'time-from-string','urn:oasis:names:tc:xacml:3.0:function:time-from-string',16);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (18,1,1,null,null,null,0,0,'string-from-time','urn:oasis:names:tc:xacml:3.0:function:string-from-time',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (19,1,1,null,null,null,0,0,'date-from-string','urn:oasis:names:tc:xacml:3.0:function:date-from-string',21);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (20,1,1,null,null,null,0,0,'string-from-date','urn:oasis:names:tc:xacml:3.0:function:string-from-date',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (21,1,1,null,null,null,0,0,'dateTime-from-string','urn:oasis:names:tc:xacml:3.0:function:dateTime-from-string',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (22,1,1,null,null,null,0,0,'string-from-dateTime','urn:oasis:names:tc:xacml:3.0:function:string-from-dateTime',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (23,1,1,null,null,null,0,0,'anyURI-from-string','urn:oasis:names:tc:xacml:3.0:function:anyURI-from-string',27);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (24,1,1,null,null,null,0,0,'string-from-anyURI','urn:oasis:names:tc:xacml:3.0:function:string-from-anyURI',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (25,1,1,null,null,null,0,0,'dayTimeDuration-from-string','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-from-string',15);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (26,1,1,null,null,null,0,0,'string-from-dayTimeDuration','urn:oasis:names:tc:xacml:3.0:function:string-from-dayTimeDuration',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (27,1,1,null,null,null,0,0,'yearMonthDuration-from-string','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-from-string',23);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (28,1,1,null,null,null,0,0,'string-from-yearMonthDuration','urn:oasis:names:tc:xacml:3.0:function:string-from-yearMonthDuration',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (29,1,1,null,null,null,0,0,'x500Name-from-string','urn:oasis:names:tc:xacml:3.0:function:x500Name-from-string',14);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (30,1,1,null,null,null,0,0,'string-from-x500Name','urn:oasis:names:tc:xacml:3.0:function:string-from-x500Name',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (31,1,1,null,null,null,0,0,'rfc822Name-from-string','urn:oasis:names:tc:xacml:3.0:function:rfc822Name-from-string',20);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (32,1,1,null,null,null,0,0,'string-from-rfc822Name','urn:oasis:names:tc:xacml:3.0:function:string-from-rfc822Name',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (33,1,1,null,null,null,0,0,'ipAddress-from-string','urn:oasis:names:tc:xacml:3.0:function:ipAddress-from-string',22);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (34,1,1,null,null,null,0,0,'string-from-ipAddress','urn:oasis:names:tc:xacml:3.0:function:string-from-ipAddress',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (35,1,1,null,null,null,0,0,'dnsName-from-string','urn:oasis:names:tc:xacml:3.0:function:dnsName-from-string',17);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (36,1,1,null,null,null,0,0,'string-from-dnsName','urn:oasis:names:tc:xacml:3.0:function:string-from-dnsName',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (37,2,2,null,null,null,0,0,'anyURI-starts-with','urn:oasis:names:tc:xacml:3.0:function:anyURI-starts-with',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (38,2,2,null,null,null,0,0,'anyURI-ends-with','urn:oasis:names:tc:xacml:3.0:function:anyURI-ends-with',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (39,2,2,null,null,null,0,0,'string-contains','urn:oasis:names:tc:xacml:3.0:function:string-contains',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (40,2,2,null,null,null,0,0,'anyURI-contains','urn:oasis:names:tc:xacml:3.0:function:anyURI-contains',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (41,3,3,null,null,null,0,0,'string-substring','urn:oasis:names:tc:xacml:3.0:function:string-substring',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (42,3,3,null,null,null,0,0,'anyURI-substring','urn:oasis:names:tc:xacml:3.0:function:anyURI-substring',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (43,2,2,null,null,null,0,0,'boolean-equal','urn:oasis:names:tc:xacml:1.0:function:boolean-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (44,2,2,null,null,null,0,0,'integer-equal','urn:oasis:names:tc:xacml:1.0:function:integer-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (45,2,2,null,null,null,0,0,'double-equal','urn:oasis:names:tc:xacml:1.0:function:double-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (46,2,2,null,null,null,0,0,'date-equal','urn:oasis:names:tc:xacml:1.0:function:date-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (47,2,2,null,null,null,0,0,'time-equal','urn:oasis:names:tc:xacml:1.0:function:time-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (48,2,2,null,null,null,0,0,'dateTime-equal','urn:oasis:names:tc:xacml:1.0:function:dateTime-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (49,2,2,null,null,null,0,0,'dayTimeDuration-equal','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (50,2,2,null,null,null,0,0,'yearMonthDuration-equal','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (51,2,2,null,null,null,0,0,'anyURI-equal','urn:oasis:names:tc:xacml:1.0:function:anyURI-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (52,2,2,null,null,null,0,0,'x500Name-equal','urn:oasis:names:tc:xacml:1.0:function:x500Name-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (53,2,2,null,null,null,0,0,'rfc822Name-equal','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (54,2,2,null,null,null,0,0,'hexBinary-equal','urn:oasis:names:tc:xacml:1.0:function:hexBinary-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (55,2,2,null,null,null,0,0,'base64Binary-equal','urn:oasis:names:tc:xacml:1.0:function:base64Binary-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (56,2,2,null,null,null,0,0,'integer-add','urn:oasis:names:tc:xacml:1.0:function:integer-add',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (57,2,2,null,null,null,0,0,'double-add','urn:oasis:names:tc:xacml:1.0:function:double-add',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (58,2,2,null,null,null,0,0,'double-subtract','urn:oasis:names:tc:xacml:1.0:function:double-subtract',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (59,2,2,null,null,null,0,0,'integer-multiply','urn:oasis:names:tc:xacml:1.0:function:integer-multiply',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (60,2,2,null,null,null,0,0,'double-multiply','urn:oasis:names:tc:xacml:1.0:function:double-multiply',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (61,2,2,null,null,null,0,0,'integer-divide','urn:oasis:names:tc:xacml:1.0:function:integer-divide',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (62,2,2,null,null,null,0,0,'double-divide','urn:oasis:names:tc:xacml:1.0:function:double-divide',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (63,2,2,null,null,null,0,0,'integer-mod','urn:oasis:names:tc:xacml:1.0:function:integer-mod',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (64,1,1,null,null,null,0,0,'integer-abs','urn:oasis:names:tc:xacml:1.0:function:integer-abs',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (65,1,1,null,null,null,0,0,'double-abs','urn:oasis:names:tc:xacml:1.0:function:double-abs',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (66,1,1,null,null,null,0,0,'round','urn:oasis:names:tc:xacml:1.0:function:round',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (67,1,1,null,null,null,0,0,'floor','urn:oasis:names:tc:xacml:1.0:function:floor',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (68,1,1,null,null,null,0,0,'string-normalize-space','urn:oasis:names:tc:xacml:1.0:function:string-normalize-space',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (69,1,1,null,null,null,0,0,'string-normalize-to-lower-case','urn:oasis:names:tc:xacml:1.0:function:string-normalize-to-lower-case',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (70,1,1,null,null,null,0,0,'integer-to-double','urn:oasis:names:tc:xacml:1.0:function:integer-to-double',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (71,2,2,null,null,null,0,0,'integer-greater-than','urn:oasis:names:tc:xacml:1.0:function:integer-greater-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (72,2,2,null,null,null,0,0,'integer-less-than','urn:oasis:names:tc:xacml:1.0:function:integer-less-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (73,2,2,null,null,null,0,0,'integer-less-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (74,2,2,null,null,null,0,0,'double-greater-than','urn:oasis:names:tc:xacml:1.0:function:double-greater-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (75,2,2,null,null,null,0,0,'double-greater-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:double-greater-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (76,2,2,null,null,null,0,0,'double-less-than','urn:oasis:names:tc:xacml:1.0:function:double-less-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (77,2,2,null,null,null,0,0,'double-less-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:double-less-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (78,2,2,null,null,null,0,0,'dateTime-add-dayTimeDuration','urn:oasis:names:tc:xacml:3.0:function:dateTime-add-dayTimeDuration',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (79,2,2,null,null,null,0,0,'dateTime-add-yearMonthDuration','urn:oasis:names:tc:xacml:3.0:function:dateTime-add-yearMonthDuration',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (80,2,2,null,null,null,0,0,'dateTime-subtract-dayTimeDuration','urn:oasis:names:tc:xacml:3.0:function:dateTime-subtract-dayTimeDuration',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (81,2,2,null,null,null,0,0,'dateTime-subtract-yearMonthDuration','urn:oasis:names:tc:xacml:3.0:function:dateTime-subtract-yearMonthDuration',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (82,2,2,null,null,null,0,0,'date-add-yearMonthDuration','urn:oasis:names:tc:xacml:3.0:function:date-add-yearMonthDuration',21);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (83,2,2,null,null,null,0,0,'date-subtract-yearMonthDuration','urn:oasis:names:tc:xacml:3.0:function:date-subtract-yearMonthDuration',21);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (84,2,2,null,null,null,0,0,'string-greater-than','urn:oasis:names:tc:xacml:1.0:function:string-greater-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (85,2,2,null,null,null,0,0,'string-greater-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:string-greater-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (86,2,2,null,null,null,0,0,'string-less-than','urn:oasis:names:tc:xacml:1.0:function:string-less-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (87,2,2,null,null,null,0,0,'string-less-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:string-less-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (88,2,2,null,null,null,0,0,'time-greater-than','urn:oasis:names:tc:xacml:1.0:function:time-greater-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (89,2,2,null,null,null,0,0,'time-greater-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:time-greater-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (90,2,2,null,null,null,0,0,'time-less-than','urn:oasis:names:tc:xacml:1.0:function:time-less-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (91,2,2,null,null,null,0,0,'time-less-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:time-less-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (92,3,3,null,null,null,0,0,'time-in-range','urn:oasis:names:tc:xacml:2.0:function:time-in-range',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (93,2,2,null,null,null,0,0,'dateTime-greater-than','urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (94,2,2,null,null,null,0,0,'dateTime-greater-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:dateTime-greater-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (95,2,2,null,null,null,0,0,'dateTime-less-than','urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (96,2,2,null,null,null,0,0,'dateTime-less-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (97,2,2,null,null,null,0,0,'date-greater-than','urn:oasis:names:tc:xacml:1.0:function:date-greater-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (98,2,2,null,null,null,0,0,'date-greater-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:date-greater-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (99,2,2,null,null,null,0,0,'date-less-than','urn:oasis:names:tc:xacml:1.0:function:date-less-than',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (100,2,2,null,null,null,0,0,'date-less-than-or-equal','urn:oasis:names:tc:xacml:1.0:function:date-less-than-or-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (101,1,1,null,null,null,0,0,'string-one-and-only','urn:oasis:names:tc:xacml:1.0:function:string-one-and-only',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (102,1,1,null,null,null,0,0,'string-bag-size','urn:oasis:names:tc:xacml:1.0:function:string-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (103,2,2,null,null,null,0,0,'string-is-in','urn:oasis:names:tc:xacml:1.0:function:string-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (104,1,-1,null,null,null,1,0,'string-bag','urn:oasis:names:tc:xacml:1.0:function:string-bag',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (105,1,1,null,null,null,0,0,'integer-bag-size','urn:oasis:names:tc:xacml:1.0:function:integer-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (106,2,2,null,null,null,0,0,'integer-is-in','urn:oasis:names:tc:xacml:1.0:function:integer-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (107,1,-1,null,null,null,1,0,'integer-bag','urn:oasis:names:tc:xacml:1.0:function:integer-bag',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (108,1,1,null,null,null,0,0,'double-bag-size','urn:oasis:names:tc:xacml:1.0:function:double-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (109,2,2,null,null,null,0,0,'double-is-in','urn:oasis:names:tc:xacml:1.0:function:double-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (110,1,-1,null,null,null,1,0,'double-bag','urn:oasis:names:tc:xacml:1.0:function:double-bag',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (111,1,1,null,null,null,0,0,'boolean-one-and-only','urn:oasis:names:tc:xacml:1.0:function:boolean-one-and-only',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (112,1,1,null,null,null,0,0,'boolean-bag-size','urn:oasis:names:tc:xacml:1.0:function:boolean-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (113,2,2,null,null,null,0,0,'boolean-is-in','urn:oasis:names:tc:xacml:1.0:function:boolean-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (114,1,-1,null,null,null,1,0,'boolean-bag','urn:oasis:names:tc:xacml:1.0:function:boolean-bag',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (115,1,1,null,null,null,0,0,'time-one-and-only','urn:oasis:names:tc:xacml:1.0:function:time-one-and-only',16);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (116,1,1,null,null,null,0,0,'time-bag-size','urn:oasis:names:tc:xacml:1.0:function:time-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (117,2,2,null,null,null,0,0,'time-is-in','urn:oasis:names:tc:xacml:1.0:function:time-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (118,1,-1,null,null,null,1,0,'time-bag','urn:oasis:names:tc:xacml:1.0:function:time-bag',16);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (119,1,1,null,null,null,0,0,'date-one-and-only','urn:oasis:names:tc:xacml:1.0:function:date-one-and-only',21);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (120,1,1,null,null,null,0,0,'date-bag-size','urn:oasis:names:tc:xacml:1.0:function:date-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (121,2,2,null,null,null,0,0,'date-is-in','urn:oasis:names:tc:xacml:1.0:function:date-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (122,1,-1,null,null,null,1,0,'date-bag','urn:oasis:names:tc:xacml:1.0:function:date-bag',21);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (123,1,1,null,null,null,0,0,'dateTime-one-and-only','urn:oasis:names:tc:xacml:1.0:function:dateTime-one-and-only',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (124,1,1,null,null,null,0,0,'dateTime-bag-size','urn:oasis:names:tc:xacml:1.0:function:dateTime-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (125,2,2,null,null,null,0,0,'dateTime-is-in','urn:oasis:names:tc:xacml:1.0:function:dateTime-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (126,1,-1,null,null,null,1,0,'dateTime-bag','urn:oasis:names:tc:xacml:1.0:function:dateTime-bag',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (127,1,1,null,null,null,0,0,'anyURI-one-and-only','urn:oasis:names:tc:xacml:1.0:function:anyURI-one-and-only',27);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (128,1,1,null,null,null,0,0,'anyURI-bag-size','urn:oasis:names:tc:xacml:1.0:function:anyURI-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (129,2,2,null,null,null,0,0,'anyURI-is-in','urn:oasis:names:tc:xacml:1.0:function:anyURI-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (130,1,-1,null,null,null,1,0,'anyURI-bag','urn:oasis:names:tc:xacml:1.0:function:anyURI-bag',27);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (131,1,1,null,null,null,0,0,'hexBinary-one-and-only','urn:oasis:names:tc:xacml:1.0:function:hexBinary-one-and-only',24);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (132,1,1,null,null,null,0,0,'hexBinary-bag-size','urn:oasis:names:tc:xacml:1.0:function:hexBinary-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (133,2,2,null,null,null,0,0,'hexBinary-is-in','urn:oasis:names:tc:xacml:1.0:function:hexBinary-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (134,1,-1,null,null,null,1,0,'hexBinary-bag','urn:oasis:names:tc:xacml:1.0:function:hexBinary-bag',24);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (135,1,1,null,null,null,0,0,'base64Binary-one-and-only','urn:oasis:names:tc:xacml:1.0:function:base64Binary-one-and-only',13);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (136,1,1,null,null,null,0,0,'base64Binary-bag-size','urn:oasis:names:tc:xacml:1.0:function:base64Binary-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (137,2,2,null,null,null,0,0,'base64Binary-is-in','urn:oasis:names:tc:xacml:1.0:function:base64Binary-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (138,1,-1,null,null,null,1,0,'base64Binary-bag','urn:oasis:names:tc:xacml:1.0:function:base64Binary-bag',13);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (139,1,1,null,null,null,0,0,'dayTimeDuration-one-and-only','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-one-and-only',15);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (140,1,1,null,null,null,0,0,'dayTimeDuration-bag-size','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (141,2,2,null,null,null,0,0,'dayTimeDuration-is-in','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (142,1,-1,null,null,null,1,0,'dayTimeDuration-bag','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-bag',15);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (143,1,1,null,null,null,0,0,'yearMonthDuration-one-and-only','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-one-and-only',23);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (144,1,1,null,null,null,0,0,'yearMonthDuration-bag-size','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (145,2,2,null,null,null,0,0,'yearMonthDuration-is-in','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (146,1,-1,null,null,null,1,0,'yearMonthDuration-bag','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-bag',23);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (147,1,1,null,null,null,0,0,'x500Name-one-and-only','urn:oasis:names:tc:xacml:1.0:function:x500Name-one-and-only',14);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (148,1,1,null,null,null,0,0,'x500Name-bag-size','urn:oasis:names:tc:xacml:1.0:function:x500Name-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (149,2,2,null,null,null,0,0,'x500Name-is-in','urn:oasis:names:tc:xacml:1.0:function:x500Name-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (150,1,-1,null,null,null,1,0,'x500Name-bag','urn:oasis:names:tc:xacml:1.0:function:x500Name-bag',14);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (151,1,1,null,null,null,0,0,'rfc822Name-one-and-only','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-one-and-only',20);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (152,1,1,null,null,null,0,0,'rfc822Name-bag-size','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (153,2,2,null,null,null,0,0,'rfc822Name-is-in','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (154,1,-1,null,null,null,1,0,'rfc822Name-bag','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-bag',20);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (155,1,1,null,null,null,0,0,'ipAddress-one-and-only','urn:oasis:names:tc:xacml:2.0:function:ipAddress-one-and-only',22);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (156,1,1,null,null,null,0,0,'ipAddress-bag-size','urn:oasis:names:tc:xacml:2.0:function:ipAddress-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (157,2,2,null,null,null,0,0,'ipAddress-is-in','urn:oasis:names:tc:xacml:2.0:function:ipAddress-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (158,1,-1,null,null,null,1,0,'ipAddress-bag','urn:oasis:names:tc:xacml:2.0:function:ipAddress-bag',22);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (159,1,1,null,null,null,0,0,'dnsName-one-and-only','urn:oasis:names:tc:xacml:2.0:function:dnsName-one-and-only',17);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (160,1,1,null,null,null,0,0,'dnsName-bag-size','urn:oasis:names:tc:xacml:2.0:function:dnsName-bag-size',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (161,2,2,null,null,null,0,0,'dnsName-is-in','urn:oasis:names:tc:xacml:2.0:function:dnsName-is-in',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (162,1,-1,null,null,null,1,0,'dnsName-bag','urn:oasis:names:tc:xacml:2.0:function:dnsName-bag',17);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (163,2,2,null,null,null,0,0,'string-regexp-match','urn:oasis:names:tc:xacml:1.0:function:string-regexp-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (164,2,2,null,null,null,0,0,'anyURI-regexp-match','urn:oasis:names:tc:xacml:2.0:function:anyURI-regexp-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (165,2,2,null,null,null,0,0,'ipAddress-regexp-match','urn:oasis:names:tc:xacml:2.0:function:ipAddress-regexp-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (166,2,2,null,null,null,0,0,'dnsName-regexp-match','urn:oasis:names:tc:xacml:2.0:function:dnsName-regexp-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (167,2,2,null,null,null,0,0,'rfc822Name-regexp-match','urn:oasis:names:tc:xacml:2.0:function:rfc822Name-regexp-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (168,2,2,null,null,null,0,0,'x500Name-regexp-match','urn:oasis:names:tc:xacml:2.0:function:x500Name-regexp-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (169,2,2,null,null,null,1,0,'string-intersection','urn:oasis:names:tc:xacml:1.0:function:string-intersection',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (170,2,2,null,null,null,0,0,'string-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (171,2,-1,null,null,null,1,0,'string-union','urn:oasis:names:tc:xacml:1.0:function:string-union',26);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (172,2,2,null,null,null,0,0,'string-subset','urn:oasis:names:tc:xacml:1.0:function:string-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (173,2,2,null,null,null,0,0,'string-set-equals','urn:oasis:names:tc:xacml:1.0:function:string-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (174,2,2,null,null,null,0,0,'integer-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:integer-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (175,2,-1,null,null,null,1,0,'integer-union','urn:oasis:names:tc:xacml:1.0:function:integer-union',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (176,2,2,null,null,null,0,0,'integer-subset','urn:oasis:names:tc:xacml:1.0:function:integer-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (177,2,2,null,null,null,0,0,'integer-set-equals','urn:oasis:names:tc:xacml:1.0:function:integer-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (178,2,2,null,null,null,0,0,'double-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:double-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (179,2,-1,null,null,null,1,0,'double-union','urn:oasis:names:tc:xacml:1.0:function:double-union',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (180,2,2,null,null,null,0,0,'double-subset','urn:oasis:names:tc:xacml:1.0:function:double-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (181,2,2,null,null,null,0,0,'double-set-equals','urn:oasis:names:tc:xacml:1.0:function:double-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (182,2,2,null,null,null,1,0,'boolean-intersection','urn:oasis:names:tc:xacml:1.0:function:boolean-intersection',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (183,2,2,null,null,null,0,0,'boolean-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:boolean-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (184,2,-1,null,null,null,1,0,'boolean-union','urn:oasis:names:tc:xacml:1.0:function:boolean-union',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (185,2,2,null,null,null,0,0,'boolean-subset','urn:oasis:names:tc:xacml:1.0:function:boolean-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (186,2,2,null,null,null,0,0,'boolean-set-equals','urn:oasis:names:tc:xacml:1.0:function:boolean-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (187,2,2,null,null,null,1,0,'time-intersection','urn:oasis:names:tc:xacml:1.0:function:time-intersection',16);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (188,2,2,null,null,null,0,0,'time-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:time-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (189,2,-1,null,null,null,1,0,'time-union','urn:oasis:names:tc:xacml:1.0:function:time-union',16);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (190,2,2,null,null,null,0,0,'time-subset','urn:oasis:names:tc:xacml:1.0:function:time-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (191,2,2,null,null,null,0,0,'time-set-equals','urn:oasis:names:tc:xacml:1.0:function:time-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (192,2,2,null,null,null,1,0,'date-intersection','urn:oasis:names:tc:xacml:1.0:function:date-intersection',21);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (193,2,2,null,null,null,0,0,'date-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:date-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (194,2,-1,null,null,null,1,0,'date-union','urn:oasis:names:tc:xacml:1.0:function:date-union',21);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (195,2,2,null,null,null,0,0,'date-subset','urn:oasis:names:tc:xacml:1.0:function:date-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (196,2,2,null,null,null,0,0,'date-set-equals','urn:oasis:names:tc:xacml:1.0:function:date-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (197,2,2,null,null,null,1,0,'dateTime-intersection','urn:oasis:names:tc:xacml:1.0:function:dateTime-intersection',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (198,2,2,null,null,null,0,0,'dateTime-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:dateTime-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (199,2,-1,null,null,null,1,0,'dateTime-union','urn:oasis:names:tc:xacml:1.0:function:dateTime-union',19);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (200,2,2,null,null,null,0,0,'dateTime-subset','urn:oasis:names:tc:xacml:1.0:function:dateTime-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (201,2,2,null,null,null,0,0,'dateTime-set-equals','urn:oasis:names:tc:xacml:1.0:function:dateTime-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (202,2,2,null,null,null,1,0,'anyURI-intersection','urn:oasis:names:tc:xacml:1.0:function:anyURI-intersection',27);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (203,2,2,null,null,null,0,0,'anyURI-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:anyURI-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (204,2,-1,null,null,null,1,0,'anyURI-union','urn:oasis:names:tc:xacml:1.0:function:anyURI-union',27);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (205,2,2,null,null,null,0,0,'anyURI-subset','urn:oasis:names:tc:xacml:1.0:function:anyURI-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (206,2,2,null,null,null,0,0,'anyURI-set-equals','urn:oasis:names:tc:xacml:1.0:function:anyURI-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (207,2,2,null,null,null,1,0,'hexBinary-intersection','urn:oasis:names:tc:xacml:1.0:function:hexBinary-intersection',24);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (208,2,2,null,null,null,0,0,'hexBinary-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:hexBinary-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (209,2,-1,null,null,null,1,0,'hexBinary-union','urn:oasis:names:tc:xacml:1.0:function:hexBinary-union',24);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (210,2,2,null,null,null,0,0,'hexBinary-subset','urn:oasis:names:tc:xacml:1.0:function:hexBinary-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (211,2,2,null,null,null,0,0,'hexBinary-set-equals','urn:oasis:names:tc:xacml:1.0:function:hexBinary-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (212,2,2,null,null,null,1,0,'base64Binary-intersection','urn:oasis:names:tc:xacml:1.0:function:base64Binary-intersection',13);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (213,2,2,null,null,null,0,0,'base64Binary-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:base64Binary-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (214,2,-1,null,null,null,1,0,'base64Binary-union','urn:oasis:names:tc:xacml:1.0:function:base64Binary-union',13);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (215,2,2,null,null,null,0,0,'base64Binary-subset','urn:oasis:names:tc:xacml:1.0:function:base64Binary-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (216,2,2,null,null,null,0,0,'base64Binary-set-equals','urn:oasis:names:tc:xacml:1.0:function:base64Binary-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (217,2,2,null,null,null,1,0,'dayTimeDuration-intersection','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-intersection',15);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (218,2,2,null,null,null,0,0,'dayTimeDuration-at-least-one-member-of','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (219,2,-1,null,null,null,1,0,'dayTimeDuration-union','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-union',15);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (220,2,2,null,null,null,0,0,'dayTimeDuration-subset','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (221,2,2,null,null,null,0,0,'dayTimeDuration-set-equals','urn:oasis:names:tc:xacml:3.0:function:dayTimeDuration-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (222,2,2,null,null,null,1,0,'yearMonthDuration-intersection','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-intersection',23);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (223,2,2,null,null,null,0,0,'yearMonthDuration-at-least-one-member-of','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (224,2,-1,null,null,null,1,0,'yearMonthDuration-union','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-union',23);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (225,2,2,null,null,null,0,0,'yearMonthDuration-subset','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (226,2,2,null,null,null,0,0,'yearMonthDuration-set-equals','urn:oasis:names:tc:xacml:3.0:function:yearMonthDuration-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (227,2,2,null,null,null,1,0,'x500Name-intersection','urn:oasis:names:tc:xacml:1.0:function:x500Name-intersection',14);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (228,2,2,null,null,null,0,0,'x500Name-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:x500Name-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (229,2,-1,null,null,null,1,0,'x500Name-union','urn:oasis:names:tc:xacml:1.0:function:x500Name-union',14);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (230,2,2,null,null,null,0,0,'x500Name-subset','urn:oasis:names:tc:xacml:1.0:function:x500Name-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (231,2,2,null,null,null,0,0,'x500Name-set-equals','urn:oasis:names:tc:xacml:1.0:function:x500Name-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (232,2,2,null,null,null,1,0,'rfc822Name-intersection','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-intersection',20);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (233,2,2,null,null,null,0,0,'rfc822Name-at-least-one-member-of','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-at-least-one-member-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (234,2,-1,null,null,null,1,0,'rfc822Name-union','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-union',20);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (235,2,2,null,null,null,0,0,'rfc822Name-subset','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-subset',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (236,2,2,null,null,null,0,0,'rfc822Name-set-equals','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-set-equals',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (237,2,2,null,null,null,0,0,'x500Name-match','urn:oasis:names:tc:xacml:1.0:function:x500Name-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (238,2,2,null,null,null,0,0,'rfc822Name-match','urn:oasis:names:tc:xacml:1.0:function:rfc822Name-match',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (239,2,2,null,null,null,1,0,'integer-intersection','urn:oasis:names:tc:xacml:1.0:function:integer-intersection',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (240,2,2,null,null,null,1,0,'double-intersection','urn:oasis:names:tc:xacml:1.0:function:double-intersection',25);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (241,0,-1,null,null,null,0,0,'or','urn:oasis:names:tc:xacml:1.0:function:or',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (242,0,-1,null,null,null,0,0,'and','urn:oasis:names:tc:xacml:1.0:function:and',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (243,2,-1,null,null,null,0,0,'n-of','urn:oasis:names:tc:xacml:1.0:function:n-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (244,1,1,null,null,null,0,0,'not','urn:oasis:names:tc:xacml:1.0:function:not',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (245,2,-1,1,-1,'1',0,1,'any-of','urn:oasis:names:tc:xacml:3.0:function:any-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (246,2,-1,1,-1,'1',0,1,'all-of','urn:oasis:names:tc:xacml:3.0:function:all-of',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (247,2,-1,1,-1,'0',0,1,'any-of-any','urn:oasis:names:tc:xacml:3.0:function:any-of-any',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (248,3,3,2,2,'1',0,1,'all-of-any','urn:oasis:names:tc:xacml:1.0:function:all-of-any',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (249,3,3,2,2,'1',0,1,'any-of-all','urn:oasis:names:tc:xacml:1.0:function:any-of-all',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (250,3,3,2,2,'1',0,1,'all-of-all','urn:oasis:names:tc:xacml:1.0:function:all-of-all',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (251,2,-1,1,-1,'1',1,1,'map','urn:oasis:names:tc:xacml:3.0:function:map',null);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (252,1,1,null,null,null,0,0,'xpath-node-count','urn:oasis:names:tc:xacml:3.0:function:xpath-node-count',12);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (253,2,2,null,null,null,0,0,'xpath-node-equal','urn:oasis:names:tc:xacml:3.0:function:xpath-node-equal',18);
-INSERT INTO XACML.FUNCTIONDEFINITION (ID,ARG_LB,ARG_UB,HO_ARG_LB,HO_ARG_UB,HO_PRIMITIVE,IS_BAG_RETURN,IS_HIGHER_ORDER,SHORT_NAME,XACML_ID,RETURN_DATATYPE) VALUES (254,2,2,null,null,null,0,0,'xpath-node-match','urn:oasis:names:tc:xacml:3.0:function:xpath-node-match',18);
-
-
-INSERT INTO XACML.GLOBALROLESETTINGS (ROLE,LOCKDOWN) VALUES ('super-admin',0);
-
-
-INSERT INTO XACML.PIPCONFIGPARAMS (ID,PARAM_DEFAULT,PARAM_NAME,PARAM_VALUE,REQUIRED,PIP_ID) VALUES (1711,null,'type','jdbc','0',1709);
-INSERT INTO XACML.PIPCONFIGPARAMS (ID,PARAM_DEFAULT,PARAM_NAME,PARAM_VALUE,REQUIRED,PIP_ID) VALUES (1712,null,'jdbc.url','jdbc:h2:file:/','0',1709);
-INSERT INTO XACML.PIPCONFIGPARAMS (ID,PARAM_DEFAULT,PARAM_NAME,PARAM_VALUE,REQUIRED,PIP_ID) VALUES (1713,null,'jdbc.driver','org.h2.Driver','0',1709);
-INSERT INTO XACML.PIPCONFIGPARAMS (ID,PARAM_DEFAULT,PARAM_NAME,PARAM_VALUE,REQUIRED,PIP_ID) VALUES (1714,null,'jdbc.conn.password','smil3yfc','0',1709);
-
-
-
-
-
-
-
-
-INSERT INTO XACML.PIPTYPE (ID,TYPE) VALUES (500,'SQL');
-INSERT INTO XACML.PIPTYPE (ID,TYPE) VALUES (501,'LDAP');
-INSERT INTO XACML.PIPTYPE (ID,TYPE) VALUES (502,'CSV');
-INSERT INTO XACML.PIPTYPE (ID,TYPE) VALUES (503,'Hyper-CSV');
-INSERT INTO XACML.PIPTYPE (ID,TYPE) VALUES (504,'Custom');
-
-
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (29,'S','ordered-deny-overrides','urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:ordered-deny-overrides');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (30,'S','on-permit-apply-second','urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:on-permit-apply-second');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (31,'S','deny-overrides','urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:deny-overrides');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (32,'S','permit-unless-deny','urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:permit-unless-deny');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (33,'S','deny-unless-permit','urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:deny-unless-permit');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (34,'S','permit-overrides','urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:permit-overrides');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (35,'S','only-one-applicable','urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:only-one-applicable');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (36,'S','first-applicable','urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:first-applicable');
-INSERT INTO XACML.POLICYALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (37,'S','ordered-permit-overrides','urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:ordered-permit-overrides');
-
-
-
-
-
-
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (38,'S','permit-unless-deny','urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-unless-deny');
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (39,'S','permit-overrides','urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides');
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (40,'S','deny-overrides','urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides');
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (41,'S','ordered-permit-overrides','urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:ordered-permit-overrides');
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (42,'S','deny-unless-permit','urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-unless-permit');
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (43,'S','ordered-deny-overrides','urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:ordered-deny-overrides');
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (44,'S','only-one-applicable','urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:only-one-applicable');
-INSERT INTO XACML.RULEALGORITHMS (ID,IS_STANDARD,SHORT_NAME,XACML_ID) VALUES (45,'S','first-applicable','urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable');
-
-
-INSERT INTO XACML.SEQUENCE (SEQ_NAME,SEQ_COUNT) VALUES ('SEQ_GEN',3050);
-
-
-
-ALTER TABLE XACML.AttributeAssignment ADD CONSTRAINT FK_AttributeAssignment_OBADVICE_id
-FOREIGN KEY (OBADVICE_id) REFERENCES XACML.Obadvice (id);
-ALTER TABLE XACML.PIPResolverParams ADD CONSTRAINT FK_PIPResolverParams_ID_RESOLVER
-FOREIGN KEY (ID_RESOLVER) REFERENCES XACML.PIPResolver (id);
-ALTER TABLE XACML.Attribute ADD CONSTRAINT FK_Attribute_category
-FOREIGN KEY (category) REFERENCES XACML.Category (id);
-ALTER TABLE XACML.Attribute ADD CONSTRAINT FK_Attribute_constraint_type
-FOREIGN KEY (constraint_type) REFERENCES XACML.ConstraintType (id);
-ALTER TABLE XACML.Attribute ADD CONSTRAINT FK_Attribute_datatype
-FOREIGN KEY (datatype) REFERENCES XACML.Datatype (id);
-ALTER TABLE XACML.FunctionArguments ADD CONSTRAINT FK_FunctionArguments_function_id
-FOREIGN KEY (function_id) REFERENCES XACML.FunctionDefinition (id);
-ALTER TABLE XACML.FunctionArguments ADD CONSTRAINT FK_FunctionArguments_datatype_id
-FOREIGN KEY (datatype_id) REFERENCES XACML.Datatype (id);
-ALTER TABLE XACML.ObadviceExpressions ADD CONSTRAINT FK_ObadviceExpressions_obadvice_id
-FOREIGN KEY (obadvice_id) REFERENCES XACML.Obadvice (id);
-ALTER TABLE XACML.ObadviceExpressions ADD CONSTRAINT FK_ObadviceExpressions_attribute_id
-FOREIGN KEY (attribute_id) REFERENCES XACML.Attribute (id);
-ALTER TABLE XACML.ConstraintValues ADD CONSTRAINT FK_ConstraintValues_attribute_id
-FOREIGN KEY (attribute_id) REFERENCES XACML.Attribute (id);
-ALTER TABLE XACML.DecisionSettings ADD CONSTRAINT FK_DecisionSettings_datatype
-FOREIGN KEY (datatype) REFERENCES XACML.Datatype (id);
-ALTER TABLE XACML.PIPConfiguration ADD CONSTRAINT FK_PIPConfiguration_TYPE
-FOREIGN KEY (TYPE) REFERENCES XACML.PIPType (id);
-
-ALTER TABLE FunctionDefinition ADD CONSTRAINT FK_FunctionDefinition_return_datatype
-FOREIGN KEY (return_datatype) REFERENCES XACML.Datatype (id);
-ALTER TABLE PIPResolver ADD CONSTRAINT FK_PIPResolver_PIP_ID
-FOREIGN KEY (PIP_ID) REFERENCES XACML.PIPConfiguration (id);
-ALTER TABLE PIPConfigParams ADD CONSTRAINT FK_PIPConfigParams_PIP_ID
-FOREIGN KEY (PIP_ID) REFERENCES XACML.PIPConfiguration (id);
-
-ALTER TABLE XACML.PolicyEntity ADD CONSTRAINT UNQ_PolicyEntity_0 UNIQUE (policyName, scope, deleted);
-ALTER TABLE XACML.PolicyEntity ADD CONSTRAINT FK_PolicyEntity_configurationDataId FOREIGN KEY (configurationDataId)
- REFERENCES XACML.ConfigurationDataEntity (configurationDataId);
diff --git a/packages/base/src/files/install/mysql/data/151001_downgrade_script.sql b/packages/base/src/files/install/mysql/data/151001_downgrade_script.sql
deleted file mode 100644
index 06cf389a..00000000
--- a/packages/base/src/files/install/mysql/data/151001_downgrade_script.sql
+++ /dev/null
@@ -1,248 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-SET FOREIGN_KEY_CHECKS=0;
-DROP TABLE IF EXISTS XACML.ENFORCINGTYPE;
-DROP TABLE IF EXISTS XACML.ACTIONPOLICYDICT;
-DROP TABLE IF EXISTS XACML.TERM;
-DROP TABLE IF EXISTS XACML.PROTOCOLLIST;
-DROP TABLE IF EXISTS XACML.PORTLIST;
-DROP TABLE IF EXISTS XACML.PREFIXLIST;
-DROP TABLE IF EXISTS XACML.ADDRESSGROUP;
-DROP TABLE IF EXISTS XACML.POLICYSCORE;
-DROP TABLE IF EXISTS XACML.VSCLACTION;
-DROP TABLE IF EXISTS XACML.VNFTYPE;
-DROP TABLE IF EXISTS XACML.ATTRIBUTE;
-DROP TABLE IF EXISTS XACML.DECISIONSETTINGS;
-DROP TABLE IF EXISTS XACML.POLICY_MANAGEMENT;
-DROP TABLE IF EXISTS XACML.SCOPES;
-
-DROP TABLE IF EXISTS XACML.SERVICEGROUP;
-CREATE TABLE XACML.SERVICEGROUP
-(
-id integer NOT NULL,
-name varchar(32),
-type varchar(16),
-transportprotocol varchar(255),
-appprotocol varchar(255),
-ports varchar(255),
-`desc` varchar(255),
-primary key(id)
-)
-;
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.SERVICEGROUP TO POLICY_USER;
-
-
-DROP TABLE IF EXISTS XACML.EnforcingType;
-CREATE TABLE XACML.EnforcingType
-(
-id INTEGER NOT NULL,
- connectionQuery VARCHAR(255) NOT NULL,
- enforcingType VARCHAR(255) NOT NULL UNIQUE,
- script VARCHAR(255) NOT NULL,
- valueQuery VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.ActionPolicyDict;
-CREATE TABLE XACML.ActionPolicyDict
-(
-id INTEGER NOT NULL,
- ATTRIBUTE_NAME VARCHAR(45) NOT NULL,
- Body VARCHAR(4096),
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048),
- Headers VARCHAR(1024),
- Method VARCHAR(45) NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- Type VARCHAR(45) NOT NULL,
- URL VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.TERM;
-CREATE TABLE XACML.TERM
-(
-id INTEGER NOT NULL,
- description VARCHAR(100),
- action VARCHAR(100),
- destIPList VARCHAR(100),
- destPortList VARCHAR(100),
- portList VARCHAR(100),
- protocolList VARCHAR(100),
- srcIPList VARCHAR(100),
- srcPortList VARCHAR(100),
- termName VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PROTOCOLLIST;
-CREATE TABLE XACML.PROTOCOLLIST
-(
-id INTEGER NOT NULL,
- description VARCHAR(64),
- protocolname VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PORTLIST;
-CREATE TABLE XACML.PORTLIST
-(
-id INTEGER NOT NULL,
- description VARCHAR(64),
- portname VARCHAR(45) NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.PREFIXLIST;
-CREATE TABLE XACML.PREFIXLIST
-(
-id INTEGER NOT NULL,
- pl_name VARCHAR(45) NOT NULL,
- pl_value VARCHAR(64) NOT NULL,
- description VARCHAR(255),
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.ADDRESSGROUP;
-CREATE TABLE ADDRESSGROUP
-(
- id INTEGER NOT NULL,
- name varchar(32),
- description VARCHAR(64),
- prefixlist varchar(255)
-);
-
-CREATE INDEX idx_addressgroup on XACML.ADDRESSGROUP(ID);
-
-DROP TABLE IF EXISTS XACML.POLICYSCORE;
-CREATE TABLE XACML.POLICYSCORE
-(
-POLICY_NAME VARCHAR(200) NOT NULL,
- POLICY_SCORE VARCHAR(100),
- PRIMARY KEY (POLICY_NAME)
-)
-;
-
-CREATE TABLE XACML.VSCLACTION
-(
-ID INTEGER NOT NULL,
-VSCL_ACTION VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-CREATE TABLE XACML.VNFTYPE
-(
-ID INTEGER NOT NULL,
-VNF_TYPE VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-)
-;
-
-DROP TABLE IF EXISTS XACML.ATTRIBUTE;
-CREATE TABLE XACML.ATTRIBUTE
-(
-id INTEGER NOT NULL,
- ATTRIBUTE_VALUE VARCHAR(255),
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048),
- is_designator CHAR NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- PRIORITY VARCHAR(45),
- selector_path VARCHAR(2048),
- xacml_id VARCHAR(100) NOT NULL UNIQUE,
- category INTEGER,
- constraint_type INTEGER,
- datatype INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.DECISIONSETTINGS;
-CREATE TABLE XACML.DECISIONSETTINGS
-(
-id INTEGER NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048),
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- PRIORITY VARCHAR(45),
- xacml_id VARCHAR(45) NOT NULL UNIQUE,
- datatype INTEGER,
- PRIMARY KEY (id)
-)
-;
-
-DROP TABLE IF EXISTS XACML.POLICY_MANANGEMENT;
-CREATE TABLE XACML.POLICY_MANANGEMENT
-(
-id INTEGER NOT NULL,
- CONFIG_NAME VARCHAR(45) NOT NULL,
- CREATE_DATE_TIME TIMESTAMP NOT NULL,
- CREATED_BY VARCHAR(45) NOT NULL,
- ECOMP_NAME VARCHAR(45) NOT NULL,
- POLICY_NAME VARCHAR(45) NOT NULL,
- scope VARCHAR(45) NOT NULL,
- UPDATE_DATE_TIME TIMESTAMP NOT NULL,
- UPDATED_BY VARCHAR(45) NOT NULL,
- XML text NOT NULL,
- PRIMARY KEY (id)
-)
-;
-
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.ENFORCINGTYPE;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.ACTIONPOLICYDICT;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.TERM;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.PROTOCOLLIST;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.PORTLIST;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.PREFIXLIST;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.ADDRESSGROUP;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.POLICYSCORE;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.VSCLACTION;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.VNFTYPE;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.ATTRIBUTE;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.DECISIONSETTINGS;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.POLICY_MANAGEMENT;
-GRANT INSERT, UPDATE, DELETE, SELECT XACML.SCOPES;
-
-
-set foreign_key_checks=1;
diff --git a/packages/base/src/files/install/mysql/data/151001_upgrade_script.sql b/packages/base/src/files/install/mysql/data/151001_upgrade_script.sql
deleted file mode 100644
index 9708fd42..00000000
--- a/packages/base/src/files/install/mysql/data/151001_upgrade_script.sql
+++ /dev/null
@@ -1,246 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-set foreign_key_checks=0;
-DROP TABLE IF EXISTS XACML.SERVICEGROUP;
-CREATE TABLE XACML.SERVICEGROUP
-(
-id integer NOT NULL,
-name varchar(32),
-type varchar(16),
-transportprotocol varchar(255),
-appprotocol varchar(255),
-ports varchar(255),
-description varchar(255),
-primary key(id)
-)
-;
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.SERVICEGROUP TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.ENFORCINGTYPE;
-CREATE TABLE XACML.ENFORCINGTYPE
-(
-ID INTEGER NOT NULL,
-ENFORCINGTYPE VARCHAR(255) NOT NULL,
-SCRIPT VARCHAR(5000) NOT NULL,
-CONNECTIONQUERY VARCHAR(1000) NOT NULL,
-VALUEQUERY VARCHAR(1000) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.ENFORCINGTYPE TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.ACTIONPOLICYDICT;
-CREATE TABLE XACML.ACTIONPOLICYDICT
-(
-ID INTEGER NOT NULL,
-TYPE VARCHAR(45) NOT NULL,
-URL VARCHAR(45) NOT NULL,
-METHOD VARCHAR(45) NOT NULL,
-HEADERS VARCHAR(1024) NOT NULL,
-BODY VARCHAR(4096) NOT NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-ATTRIBUTE_NAME VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(1024),
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.ACTIONPOLICYDICT TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.TERM;
-CREATE TABLE XACML.TERM
-(
-ID INTEGER NOT NULL,
-TERMNAME VARCHAR(45) NOT NULL,
-SRCIPLIST VARCHAR(100),
-DESTIPLIST VARCHAR(100),
-PROTOCOLLIST VARCHAR(100),
-PORTLIST VARCHAR(100),
-SRCPORTLIST VARCHAR(100),
-DESTPORTLIST VARCHAR(100),
-ACTION VARCHAR(100),
-DESCRIPTION VARCHAR(100),
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.TERM TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.PROTOCOLLIST;
-CREATE TABLE XACML.PROTOCOLLIST
-(
-ID INTEGER NOT NULL,
-PROTOCOLNAME VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(64),
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.PROTOCOLLIST TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.PORTLIST;
-CREATE TABLE XACML.PORTLIST
-(
-ID INTEGER NOT NULL,
-PORTNAME VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(64),
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.PORTLIST TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.PREFIXLIST;
-CREATE TABLE XACML.PREFIXLIST
-(
-ID INTEGER NOT NULL,
-PL_NAME VARCHAR(45) NOT NULL,
-PL_VALUE VARCHAR(64),
-DESCRIPTION VARCHAR(255) NULL,
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.PREFIXLIST TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.ADDRESSGROUP;
-CREATE TABLE XACML.ADDRESSGROUP
-(
- ID INTEGER NOT NULL,
- NAME VARCHAR(32),
- DESCRIPTION VARCHAR(64),
- PREFIXLIST VARCHAR(255),
- PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.ADDRESSGROUP TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.POLICYSCORE;
-CREATE TABLE XACML.POLICYSCORE
-(
-POLICY_NAME VARCHAR(100) NOT NULL,
-POLICY_SCORE VARCHAR(100),
-PRIMARY KEY(POLICY_NAME)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.POLICYSCORE TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.VSCLACTION;
-CREATE TABLE XACML.VSCLACTION
-(
-ID INTEGER NOT NULL,
-VSCL_ACTION VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.VSCLACTION TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.VNFTYPE;
-CREATE TABLE XACML.VNFTYPE
-(
-ID INTEGER NOT NULL,
-VNF_TYPE VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.VNFTYPE TO POLICY_USER;
-
-SET FOREIGN_KEY_CHECKS=0;
-
-DROP TABLE IF EXISTS XACML.ATTRIBUTE;
-CREATE TABLE XACML.ATTRIBUTE
-(
-ID INTEGER NOT NULL,
-CREATED_BY VARCHAR(255) NOT NULL,
-CREATED_DATE TIMESTAMP,
-DESCRIPTION VARCHAR(2048),
-IS_DESIGNATOR CHAR(1) NOT NULL,
-MODIFIED_BY VARCHAR(255) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-SELECTOR_PATH VARCHAR(2048),
-XACML_ID VARCHAR(500) NOT NULL,
-CATEGORY INTEGER,
-CONSTRAINT_TYPE INTEGER,
-DATATYPE INTEGER,
-PRIORITY VARCHAR(45),
-ATTRIBUTE_VALUE VARCHAR(45),
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.ATTRIBUTE TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.DECISIONSETTINGS;
-CREATE TABLE XACML.DECISIONSETTINGS
-(
- ID INTEGER NOT NULL,
- XACML_ID VARCHAR(45) NOT NULL,
- DESCRIPTION VARCHAR(45),
- DATATYPE VARCHAR(45) NOT NULL,
- CREATED_BY VARCHAR(45) NOT NULL,
- MODIFIED_DATE TIMESTAMP NOT NULL,
- MODIFIED_BY VARCHAR(45) NOT NULL,
- PRIORITY VARCHAR(45),
- CREATED_DATE TIMESTAMP NOT NULL,
- PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.DECISIONSETTINGS TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.POLICY_MANAGEMENT;
-CREATE TABLE XACML.POLICY_MANAGEMENT
-(
- ID INTEGER NOT NULL,
- CONFIG_NAME VARCHAR(45) NOT NULL,
- CREATE_DATE_TIME TIMESTAMP,
- CREATED_BY VARCHAR(45) NOT NULL,
- ECOMP_NAME VARCHAR(45) NOT NULL,
- POLICY_NAME VARCHAR(45) NOT NULL,
- SCOPE VARCHAR(45) NOT NULL,
- UPDATE_DATE_TIME TIMESTAMP NOT NULL,
- UPDATED_BY VARCHAR(45) NOT NULL,
- XML TEXT NOT NULL,
- PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.POLICY_MANAGEMENT TO POLICY_USER;
-
-DROP TABLE IF EXISTS XACML.SCOPES;
-CREATE TABLE XACML.SCOPES
-(
- ID INTEGER NOT NULL,
- SCOPE VARCHAR(45) NOT NULL,
- PARENT_SCOPE INTEGER,
- PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.SCOPES TO POLICY_USER;
-
-
-set foreign_key_checks=1;
diff --git a/packages/base/src/files/install/mysql/data/151002_downgrade_script.sql b/packages/base/src/files/install/mysql/data/151002_downgrade_script.sql
deleted file mode 100644
index 66cdf302..00000000
--- a/packages/base/src/files/install/mysql/data/151002_downgrade_script.sql
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-REVOKE INSERT, UPDATE, DELETE, SELECT ON XACML.SECURITYZONE from policy_user;
diff --git a/packages/base/src/files/install/mysql/data/151002_upgrade_script.sql b/packages/base/src/files/install/mysql/data/151002_upgrade_script.sql
deleted file mode 100644
index 3b4d27e4..00000000
--- a/packages/base/src/files/install/mysql/data/151002_upgrade_script.sql
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.SECURITYZONE TO policy_user;
diff --git a/packages/base/src/files/install/mysql/data/151200_downgrade_script.sql b/packages/base/src/files/install/mysql/data/151200_downgrade_script.sql
deleted file mode 100644
index a3147223..00000000
--- a/packages/base/src/files/install/mysql/data/151200_downgrade_script.sql
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-set foreign_key_checks=0;
-
-DROP TABLE IF EXISTS xacml.PolicyEntity;
-DROP TABLE IF EXISTS xacml.ConfigurationDataEntity;
-DROP TABLE IF EXISTS xacml.PolicyDBDaoEntity;
-DROP TABLE IF EXISTS xacml.GroupEntity;
-DROP TABLE IF EXISTS xacml.PdpEntity;
-DROP TABLE IF EXISTS xacml.ActionBodyEntity;
-DROP TABLE IF EXISTS xacml.DatabaseLockEntity;
-DROP TABLE IF EXISTS xacml.PolicyGroupEntity;
-
-ALTER TABLE XACML.TERM DROP COLUMN FROMZONE;
-ALTER TABLE XACML.TERM DROP COLUMN TOZONE;
-
-ALTER TABLE XACML.ACTIONPOLICYDICT DROP INDEX ACTIONPOLICYDICT_UNIQUE;
-
-DROP TABLE IF EXISTS XACML.ZONE;
-
-DROP TABLE IF EXISTS XACML.POLICYVERSION;
-
-ALTER TABLE XACML.VSCLACTION DROP INDEX VSCLACTION_VSCL_ACTION_UNIQUE;
-
-set foreign_key_checks=1;
diff --git a/packages/base/src/files/install/mysql/data/151200_upgrade_script.sql b/packages/base/src/files/install/mysql/data/151200_upgrade_script.sql
deleted file mode 100644
index ecb23da0..00000000
--- a/packages/base/src/files/install/mysql/data/151200_upgrade_script.sql
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-set foreign_key_checks=0;
-
-DROP TABLE IF EXISTS xacml.PolicyEntity;
-CREATE TABLE xacml.PolicyEntity
-(
-policyId BIGINT NOT NULL AUTO_INCREMENT,
-created_by VARCHAR(255) NOT NULL,
-created_date TIMESTAMP,
-deleted BOOLEAN NOT NULL,
-description VARCHAR(2048) NOT NULL,
-modified_by VARCHAR(255) NOT NULL,
-modified_date TIMESTAMP NOT NULL,
-policyData TEXT,
-policyName VARCHAR(255) NOT NULL,
-policyVersion INTEGER,
-scope VARCHAR(255) NOT NULL,
-version INTEGER,
-actionBodyId BIGINT,
-configurationDataId BIGINT,
-PRIMARY KEY (policyId)
-);
-
-CREATE INDEX scope ON xacml.PolicyEntity (scope);
-CREATE INDEX policyName ON xacml.PolicyEntity (policyName);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.PolicyEntity to policy_user;
-
-DROP TABLE IF EXISTS xacml.ConfigurationDataEntity;
-CREATE TABLE xacml.ConfigurationDataEntity
-(
- configurationDataId BIGINT NOT NULL AUTO_INCREMENT,
- configBody TEXT,
- configType VARCHAR(255) NOT NULL,
- configurationName VARCHAR(255) NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- deleted BOOLEAN NOT NULL,
- description VARCHAR(2048) NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- version INTEGER,
- PRIMARY KEY (configurationDataId)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.ConfigurationDataEntity to policy_user;
-
-DROP TABLE IF EXISTS xacml.PolicyDBDaoEntity;
-CREATE TABLE xacml.PolicyDBDaoEntity
-(
- policyDBDaoUrl VARCHAR(500) NOT NULL,
- created_date TIMESTAMP,
- description VARCHAR(2048) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- password VARCHAR(100),
- username VARCHAR(100),
- PRIMARY KEY (policyDBDaoUrl)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.PolicyDBDaoEntity to policy_user;
-
-DROP TABLE IF EXISTS xacml.GroupEntity;
-CREATE TABLE xacml.GroupEntity
-(
-groupKey BIGINT NOT NULL AUTO_INCREMENT,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- defaultGroup BOOLEAN NOT NULL,
- deleted BOOLEAN NOT NULL,
- description VARCHAR(2048) NOT NULL,
- groupId VARCHAR(100) NOT NULL,
- groupName VARCHAR(255) NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- version INTEGER,
- PRIMARY KEY (groupKey)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.GroupEntity to policy_user;
-
-DROP TABLE IF EXISTS xacml.PdpEntity;
-CREATE TABLE xacml.PdpEntity
-(
-pdpKey BIGINT NOT NULL AUTO_INCREMENT,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- deleted BOOLEAN NOT NULL,
- description VARCHAR(2048) NOT NULL,
- jmxPort INTEGER NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- pdpId VARCHAR(255) NOT NULL,
- pdpName VARCHAR(255) NOT NULL,
- groupKey BIGINT,
- PRIMARY KEY (pdpKey)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.PdpEntity to policy_user;
-
-DROP TABLE IF EXISTS xacml.ActionBodyEntity;
-CREATE TABLE xacml.ActionBodyEntity
-(
-actionBodyId BIGINT NOT NULL AUTO_INCREMENT,
- actionBody TEXT,
- actionBodyName VARCHAR(255) NOT NULL,
- created_by VARCHAR(255) NOT NULL,
- created_date TIMESTAMP,
- deleted BOOLEAN NOT NULL,
- modified_by VARCHAR(255) NOT NULL,
- modified_date TIMESTAMP NOT NULL,
- version INTEGER,
- PRIMARY KEY (actionBodyId)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.ActionBodyEntity to policy_user;
-
-DROP TABLE IF EXISTS xacml.DatabaseLockEntity;
-CREATE TABLE xacml.DatabaseLockEntity
-(
- lock_key INTEGER NOT NULL,
- PRIMARY KEY (lock_key)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.DatabaseLockEntity to policy_user;
-
-DROP TABLE IF EXISTS xacml.PolicyGroupEntity;
-CREATE TABLE xacml.PolicyGroupEntity
-(
-groupKey BIGINT NOT NULL AUTO_INCREMENT,
- policyId BIGINT NOT NULL,
- PRIMARY KEY (groupKey,policyId)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT on xacml.PolicyGroupEntity to policy_user;
-
-ALTER TABLE xacml.PolicyEntity ADD CONSTRAINT UNQ_PolicyEntity_0 UNIQUE (policyName, scope);
-ALTER TABLE xacml.PolicyEntity ADD CONSTRAINT FK_PolicyEntity_configurationDataId FOREIGN KEY (configurationDataId)
-REFERENCES xacml.ConfigurationDataEntity (configurationDataId);
-ALTER TABLE xacml.PolicyEntity ADD CONSTRAINT FK_PolicyEntity_actionBodyId FOREIGN KEY (actionBodyId)
-REFERENCES xacml.ActionBodyEntity (actionBodyId);
-ALTER TABLE xacml.PdpEntity ADD CONSTRAINT FK_PdpEntity_groupKey FOREIGN KEY (groupKey)
-REFERENCES xacml.GroupEntity (groupKey);
-
-ALTER TABLE xacml.PolicyGroupEntity ADD CONSTRAINT FK_PolicyGroupEntity_policyId FOREIGN KEY (policyId)
-REFERENCES xacml.PolicyEntity (policyId);
-
-ALTER TABLE xacml.PolicyGroupEntity ADD CONSTRAINT FK_PolicyGroupEntity_groupKey FOREIGN KEY (groupKey)
-REFERENCES xacml.GroupEntity (groupKey);
-
--- CREATE SEQUENCE xacml.seqActBody START WITH 1;
--- CREATE SEQUENCE xacml.seqGroup INCREMENT BY 50 START WITH 50;
--- CREATE SEQUENCE xacml.seqConfig START WITH 1;
--- CREATE SEQUENCE xacml.seqPolicy START WITH 1;
--- CREATE SEQUENCE xacml.seqPdp INCREMENT BY 50 START WITH 50;
-
-DROP TABLE IF EXISTS XACML.TERM;
-CREATE TABLE XACML.TERM
-(
- ID int NOT NULL,
- termName VARCHAR(45) NOT NULL,
- fromzone VARCHAR(100),
- tozone VARCHAR(100),
- srcIPList VARCHAR(100),
- destIPList VARCHAR(100) ,
- protocolList VARCHAR(100) ,
- portList VARCHAR(100) ,
- srcPortList VARCHAR(100) ,
- destPortList VARCHAR(100) ,
- action VARCHAR(100),
- DESCRIPTION VARCHAR(100),
- PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.TERM TO policy_user;
-
-ALTER TABLE XACML.ACTIONPOLICYDICT add constraint ACTIONPOLICYDICT_UNIQUE UNIQUE(ATTRIBUTE_NAME);
-
-DROP TABLE IF EXISTS XACML.ZONE;
-CREATE TABLE XACML.ZONE
-(
- ID INTEGER NOT NULL,
- zonename VARCHAR(45) NOT NULL,
- zonevalue VARCHAR(64)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.ZONE TO policy_user;
-
-DROP TABLE IF EXISTS XACML.POLICYVERSION;
-
-CREATE TABLE XACML.POLICYVERSION
-(
-ID INTEGER NOT NULL,
-POLICY_NAME VARCHAR(255) NOT NULL,
-ACTIVE_VERSION INTEGER NULL,
-HIGHEST_VERSION INTEGER NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-GRANT INSERT, UPDATE, DELETE, SELECT ON XACML.POLICYVERSION to policy_user;
-
-ALTER TABLE XACML.VSCLACTION ADD CONSTRAINT VSCLACTION_VSCL_ACTION_UNIQUE UNIQUE(VSCL_ACTION);
-
-set foreign_key_checks=1;
diff --git a/packages/base/src/files/install/mysql/data/160200_downgrade_script.sql b/packages/base/src/files/install/mysql/data/160200_downgrade_script.sql
deleted file mode 100644
index 41baaa92..00000000
--- a/packages/base/src/files/install/mysql/data/160200_downgrade_script.sql
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-drop table if exists xacml.DCAEuuid;
-drop table if exists xacml.MicroServiceLocation;
-drop table if exists xacml.DCAEUsers;
-drop table if exists xacml.microserviceconfigname;
-drop table if exists xacml.vmType;
-
-alter table xacml.term drop column created_by;
-alter table xacml.term drop column created_date;
-alter table xacml.term drop column modified_by;
-alter table xacml.term drop column modified_date;
-
-drop table if exists xacml.pepoptions;
-drop table if exists xacml.VarbindDictionary;
-drop table if exists xacml.GocEventAlarm;
-drop table if exists xacml.GocTraversal;
-drop table if exists xacml.BRMSParamTemplate;
-
-alter table xacml.roles drop column name;
-
diff --git a/packages/base/src/files/install/mysql/data/160200_upgrade_script.sql b/packages/base/src/files/install/mysql/data/160200_upgrade_script.sql
deleted file mode 100644
index 46629a94..00000000
--- a/packages/base/src/files/install/mysql/data/160200_upgrade_script.sql
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-drop table if exists xacml.DCAEuuid;
-CREATE TABLE xacml.DCAEuuid (
- ID int NOT NULL,
- name VARCHAR(45) NOT NULL,
- description VARCHAR(64)
- );
-
-drop table if exists xacml.MicroServiceLocation;
-CREATE TABLE xacml.MicroServiceLocation (
- ID int NOT NULL,
- name VARCHAR(45) NOT NULL,
- description VARCHAR(64)
- );
-
-drop table if exists xacml.DCAEUsers;
-CREATE TABLE xacml.DCAEUsers (
- ID int NOT NULL,
- name VARCHAR(45) NOT NULL,
- description VARCHAR(64)
- );
-
-drop table if exists xacml.microserviceconfigname;
-CREATE TABLE xacml.microserviceconfigname (
- ID int NOT NULL,
- name VARCHAR(45) NOT NULL,
- description VARCHAR(64)
- );
-
-drop table if exists xacml.vmType;
-CREATE TABLE xacml.vmType (
- ID int NOT NULL,
- name VARCHAR(45) NOT NULL,
- description VARCHAR(64)
- );
-
-alter table xacml.term add created_by varchar(100);
-alter table xacml.term add created_date date;
-alter table xacml.term add modified_by varchar(100);
-alter table xacml.term add modified_date date;
-
-drop table if exists xacml.pepoptions;
-CREATE TABLE xacml.PEPOPTIONS (
-ID INT NOT NULL,
-PEP_NAME VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(1024),
-Actions VARCHAR(1024) NOT NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.VarbindDictionary;
-CREATE TABLE xacml.VarbindDictionary (
-Id INT NOT NULL,
-created_by VARCHAR(255) NOT NULL,
-created_date TIMESTAMP,
-modified_by VARCHAR(255) NOT NULL,
-modified_date TIMESTAMP NOT NULL,
-varbind_Description VARCHAR(2048),
-varbind_Name VARCHAR(45) NOT NULL UNIQUE,
-varbind_oid VARCHAR(45) NOT NULL,
-PRIMARY KEY (Id)
-);
-
-drop table if exists xacml.GocEventAlarm;
-CREATE TABLE xacml.GocEventAlarm(
-Id INT NOT NULL,
-Event VARCHAR(45) NOT NULL,
-description VARCHAR(1024),
-Alarm VARCHAR(1024) NOT NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.GocTraversal;
-CREATE TABLE xacml.GocTraversal(
-ID INT NOT NULL,
-TRAVERSAL VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.BRMSParamTemplate;
-CREATE TABLE xacml.BRMSParamTemplate(
-ID INT NOT NULL,
-param_template_name VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45),
-rule LONGTEXT NOT NULL,
-CREATED_DATE TIMESTAMP NOT NULL,
-CREATED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-alter table xacml.roles add name varchar(45);
-
-
-
-
diff --git a/packages/base/src/files/install/mysql/data/160201_downgrade_script.sql b/packages/base/src/files/install/mysql/data/160201_downgrade_script.sql
deleted file mode 100644
index 5f6381af..00000000
--- a/packages/base/src/files/install/mysql/data/160201_downgrade_script.sql
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-alter table xacml.attribute modify created_date timestamp;
-alter table xacml.obadvice modify created_date timestamp;
-alter table xacml.decisionsettings modify created_date timestamp;
-alter table xacml.actionpolicydict modify created_date timestamp;
-alter table xacml.ecompname modify created_date timestamp;
-alter table xacml.policyentity modify created_date timestamp;
-alter table xacml.configurationdataentity modify created_date timestamp;
-alter table xacml.policydbdaoentity modify created_date timestamp;
-
-alter table xacml.actionpolicydict modify created_date timestamp;
-alter table xacml.vsclaction modify created_date timestamp;
-alter table xacml.vnftype modify created_date timestamp;
-
-alter table xacml.groupentity modify created_date timestamp;
-alter table xacml.pdpentity modify created_date timestamp;
-alter table xacml.actionbodyentity modify created_date timestamp;
-
-alter table xacml.term modify created_date timestamp;
-alter table xacml.varbinddictionary modify created_date timestamp;
-alter table xacml.pepoptions modify created_date timestamp;
-alter table xacml.goceventalarm modify created_date timestamp;
-alter table xacml.goctraversal modify created_date timestamp;
-alter table xacml.brmsparamtemplate modify created_date timestamp;
diff --git a/packages/base/src/files/install/mysql/data/160201_upgrade_script.sql b/packages/base/src/files/install/mysql/data/160201_upgrade_script.sql
deleted file mode 100644
index 70ddf791..00000000
--- a/packages/base/src/files/install/mysql/data/160201_upgrade_script.sql
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-alter table xacml.attribute modify created_date timestamp default current_timestamp;
-alter table xacml.obadvice modify created_date timestamp default current_timestamp;
-alter table xacml.decisionsettings modify created_date timestamp default current_timestamp;
-alter table xacml.actionpolicydict modify created_date timestamp default current_timestamp;
-alter table xacml.ecompname modify created_date timestamp default current_timestamp;
-alter table xacml.policyentity modify created_date timestamp default current_timestamp;
-alter table xacml.configurationdataentity modify created_date timestamp default current_timestamp;
-alter table xacml.policydbdaoentity modify created_date timestamp default current_timestamp;
-
-alter table xacml.actionpolicydict modify created_date timestamp default current_timestamp;
-alter table xacml.vsclaction modify created_date timestamp default current_timestamp;
-alter table xacml.vnftype modify created_date timestamp default current_timestamp;
-
-alter table xacml.groupentity modify created_date timestamp default current_timestamp;
-alter table xacml.pdpentity modify created_date timestamp default current_timestamp;
-alter table xacml.actionbodyentity modify created_date timestamp default current_timestamp;
-
-alter table xacml.term modify created_date timestamp default current_timestamp;
-alter table xacml.term modify modified_date timestamp not null;
-alter table xacml.varbinddictionary modify created_date timestamp default current_timestamp;
-alter table xacml.pepoptions modify created_date timestamp default current_timestamp;
-alter table xacml.goceventalarm modify created_date timestamp default current_timestamp;
-alter table xacml.goctraversal modify created_date timestamp default current_timestamp;
-alter table xacml.brmsparamtemplate modify created_date timestamp default current_timestamp;
diff --git a/packages/base/src/files/install/mysql/data/160400_downgrade_script.sql b/packages/base/src/files/install/mysql/data/160400_downgrade_script.sql
deleted file mode 100644
index d5a990fc..00000000
--- a/packages/base/src/files/install/mysql/data/160400_downgrade_script.sql
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-drop table if exists xacml.MicroServiceModels;
-drop table if exists xacml.GocRCAlarm;
-drop table if exists xacml.xacmlGocVnfType;
-drop table if exists xacml.CLOSEDLOOPD2SERVICES;
-drop table if exists xacml.CLOSEDLOOPSITE;
-drop table if exists xacml.USERINFO;
-
-drop table if exists drools.sessioninfo;
-drop table if exists drools.WORKITEMINFO;
-drop table if exists drools.droolspdpentity;
-
-
-
diff --git a/packages/base/src/files/install/mysql/data/160400_upgrade_script.sql b/packages/base/src/files/install/mysql/data/160400_upgrade_script.sql
deleted file mode 100644
index 745b4715..00000000
--- a/packages/base/src/files/install/mysql/data/160400_upgrade_script.sql
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Base Package
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-drop table if exists xacml.MicroServiceModels;
-CREATE TABLE xacml.MicroServiceModels (
-ID INTEGER NOT NULL,
-modelName VARCHAR(75) NOT NULL,
-DESCRIPTION VARCHAR(45),
-Dependency VARCHAR(255),
-imported_by VARCHAR(45) NOT NULL,
-attributes LONGTEXT,
-ref_attributes LONGTEXT,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.GocRCAlarm;
-CREATE TABLE xacml.GocRCAlarm(
-ID int NOT NULL,
-alarmName VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL default current_timestamp,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.xacmlGocVnfType;
-CREATE TABLE xacml.xacmlGocVnfType(
-ID int NOT NULL,
-vnfName VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL default current_timestamp,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.CLOSEDLOOPD2SERVICES;
-CREATE TABLE xacml.CLOSEDLOOPD2SERVICES(
-ID INTEGER NOT NULL,
-SERVICE_NAME VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL default current_timestamp,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.CLOSEDLOOPSITE;
-CREATE TABLE xacml.CLOSEDLOOPSITE(
-ID INTEGER NOT NULL,
-SITE_NAME VARCHAR(45) NOT NULL,
-DESCRIPTION VARCHAR(45) NULL,
-CREATED_DATE TIMESTAMP NOT NULL default current_timestamp,
-CREATED_BY VARCHAR(45) NOT NULL,
-MODIFIED_DATE TIMESTAMP NOT NULL,
-MODIFIED_BY VARCHAR(45) NOT NULL,
-PRIMARY KEY(ID)
-);
-
-drop table if exists xacml.USERINFO;
-CREATE TABLE xacml.USERINFO(
-ATTUID VARCHAR(45) NOT NULL,
-NAME VARCHAR(45) NOT NULL,
-PRIMARY KEY(ATTUID)
-);
-
--- use BLOB instead of LONGVARBINARY
-drop table if exists drools.sessioninfo;
-CREATE TABLE drools.SESSIONINFO
-(
-ID BIGINT NOT NULL,
-LASTMODIFICATIONDATE TIMESTAMP,
-RULESBYTEARRAY BLOB,
-STARTDATE TIMESTAMP default current_timestamp,
-OPTLOCK INTEGER,
-PRIMARY KEY (ID)
-);
-
-drop table if exists drools.WORKITEMINFO;
-CREATE TABLE drools.WORKITEMINFO
-(
-WORKITEMID BIGINT NOT NULL,
-CREATIONDATE TIMESTAMP default current_timestamp,
-`NAME` VARCHAR(500),
-PROCESSINSTANCEID BIGINT,
-STATE BIGINT,
-OPTLOCK INTEGER,
-WORKITEMBYTEARRAY BLOB,
-PRIMARY KEY (WORKITEMID)
-);
-
-drop table if exists drools.droolspdpentity;
-CREATE TABLE drools.DROOLSPDPENTITY
-(
- PDPID VARCHAR(100) NOT NULL,
- DESIGNATED BOOLEAN NOT NULL DEFAULT FALSE,
- PRIORITY INT NOT NULL DEFAULT 0,
- UPDATEDDATE DATE NOT NULL,
- GROUPID VARCHAR(100) NOT NULL,
- SESSIONID BIGINT NOT NULL
-);
-
-
diff --git a/packages/install/pom.xml b/packages/install/pom.xml
index 8f387a56..287a9d75 100644
--- a/packages/install/pom.xml
+++ b/packages/install/pom.xml
@@ -67,12 +67,6 @@
</dependency>
<dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
- <artifactId>policy-core</artifactId>
- <version>${project.version}</version>
- <type>zip</type>
- </dependency>
- <dependency>
- <groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-management</artifactId>
<version>${project.version}</version>
<type>zip</type>
diff --git a/policy-core/pom.xml b/policy-core/pom.xml
index e151e555..18723942 100644
--- a/policy-core/pom.xml
+++ b/policy-core/pom.xml
@@ -30,103 +30,6 @@
<version>1.1.0-SNAPSHOT</version>
</parent>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>zipfile</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <attach>true</attach>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <descriptors>
- <descriptor>src/assembly/assemble_zip.xml</descriptor>
- </descriptors>
- <appendAssemblyId>false</appendAssemblyId>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.8</version>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <phase>prepare-package</phase>
- <configuration>
- <transitive>false</transitive>
- <outputDirectory>${project.build.directory}/assembly/lib</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <overWriteIfNewer>true</overWriteIfNewer>
- <useRepositoryLayout>false</useRepositoryLayout>
- <addParentPoms>false</addParentPoms>
- <copyPom>false</copyPom>
- <excludeGroupIds>org.opendaylight,com.brocade.odl</excludeGroupIds>
- <scope>provided</scope>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-version</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/versions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/versions</directory>
- <includes>
- <include>version.properties</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>copy-resources</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/etc/bvc-extensions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/etc/bvc-extensions</directory>
- <includes>
- <include>feature_config_template.cfg</include>
- <include>feature_custom.install</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
<dependencies>
<dependency>
<groupId>log4j</groupId>
diff --git a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java
index ae7cd622..d47ed617 100644
--- a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java
+++ b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicyContainer.java
@@ -22,42 +22,26 @@ package org.openecomp.policy.drools.core;
import java.io.IOException;
import java.util.Collection;
-import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.builder.KieScanner;
import org.kie.api.builder.Message;
import org.kie.api.builder.ReleaseId;
import org.kie.api.builder.Results;
-import org.kie.api.runtime.Environment;
-import org.kie.api.runtime.EnvironmentName;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
-import org.kie.api.runtime.KieSessionConfiguration;
-
-import bitronix.tm.Configuration;
-import bitronix.tm.TransactionManagerServices;
-import bitronix.tm.resource.jdbc.PoolingDataSource;
-
-import org.openecomp.policy.common.ia.IntegrityAudit;
-import org.openecomp.policy.common.ia.IntegrityAuditProperties;
-import org.openecomp.policy.drools.properties.Startable;
-import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
-import org.openecomp.policy.common.logging.flexlogger.Logger;
import org.openecomp.policy.common.logging.eelf.MessageCodes;
import org.openecomp.policy.common.logging.eelf.PolicyLogger;
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
import org.openecomp.policy.common.logging.flexlogger.PropertyUtil;
+import org.openecomp.policy.drools.properties.Startable;
/**
* This class is a wrapper around 'KieContainer', which adds the ability
@@ -296,7 +280,7 @@ public class PolicyContainer implements Startable
// loop through all of the features, and give each one
// a chance to create the 'KieSession'
- for (FeatureAPI feature : FeatureAPI.impl.getList())
+ for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList())
{
if ((kieSession = feature.activatePolicySession
(this, name, kieBaseName)) != null)
@@ -453,7 +437,7 @@ public class PolicyContainer implements Startable
// KLUDGE WARNING: this is a temporary workaround -- if there are
// no features, we don't have persistence, and 'activate' is never
// called. In this case, make sure the container is started.
- if (FeatureAPI.impl.getList().size() == 0)
+ if (PolicySessionFeatureAPI.impl.getList().size() == 0)
{
start();
}
@@ -606,7 +590,7 @@ public class PolicyContainer implements Startable
session.getKieSession().dispose();
// notify features
- for (FeatureAPI feature : FeatureAPI.impl.getList())
+ for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList())
{
feature.disposeKieSession(session);
}
@@ -673,7 +657,7 @@ public class PolicyContainer implements Startable
session.getKieSession().destroy();
// notify features
- for (FeatureAPI feature : FeatureAPI.impl.getList())
+ for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList())
{
feature.destroyKieSession(session);
}
@@ -766,7 +750,7 @@ public class PolicyContainer implements Startable
logger.info("initlogger returned");
// invoke 'globalInit' on all of the features
- for (FeatureAPI feature : FeatureAPI.impl.getList())
+ for (PolicySessionFeatureAPI feature : PolicySessionFeatureAPI.impl.getList())
{
feature.globalInit(args, configDir);
}
diff --git a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java
index 89341d6b..2149735a 100644
--- a/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java
+++ b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySession.java
@@ -20,12 +20,6 @@
package org.openecomp.policy.drools.core;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Properties;
-
-import org.kie.api.runtime.KieSession;
import org.kie.api.event.rule.AfterMatchFiredEvent;
import org.kie.api.event.rule.AgendaEventListener;
import org.kie.api.event.rule.AgendaGroupPoppedEvent;
@@ -36,14 +30,14 @@ import org.kie.api.event.rule.MatchCreatedEvent;
import org.kie.api.event.rule.ObjectDeletedEvent;
import org.kie.api.event.rule.ObjectInsertedEvent;
import org.kie.api.event.rule.ObjectUpdatedEvent;
-import org.kie.api.event.rule.RuleRuntimeEventListener;
import org.kie.api.event.rule.RuleFlowGroupActivatedEvent;
import org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent;
-
-import org.openecomp.policy.drools.core.jmx.PdpJmx;
+import org.kie.api.event.rule.RuleRuntimeEventListener;
+import org.kie.api.runtime.KieSession;
+import org.openecomp.policy.common.logging.eelf.MessageCodes;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
-import org.openecomp.policy.common.logging.eelf.MessageCodes;
+import org.openecomp.policy.drools.core.jmx.PdpJmx;
/**
* This class is a wrapper around 'KieSession', which adds the following:
@@ -145,6 +139,9 @@ public class PolicySession
// We want to continue, despite any exceptions that occur
// while rules are fired.
boolean repeat = true;
+ long minSleepTime = 100;
+ long maxSleepTime = 5000;
+ long sleepTime = maxSleepTime;
while (repeat)
{
if(this.isInterrupted()){
@@ -152,15 +149,37 @@ public class PolicySession
}
try
{
- kieSession.fireAllRules();
-
+ if (kieSession.fireAllRules() > 0)
+ {
+ // some rules fired -- reduce poll delay
+ if (sleepTime > minSleepTime)
+ {
+ sleepTime /= 2;
+ if (sleepTime < minSleepTime)
+ {
+ sleepTime = minSleepTime;
+ }
+ }
+ }
+ else
+ {
+ // no rules fired -- increase poll delay
+ if (sleepTime < maxSleepTime)
+ {
+ sleepTime *= 2;
+ if (sleepTime > maxSleepTime)
+ {
+ sleepTime = maxSleepTime;
+ }
+ }
+ }
}
catch (Throwable e)
{
logger.error(MessageCodes.EXCEPTION_ERROR, e, "startThread", "kieSession.fireUntilHalt");
}
try {
- Thread.sleep(5000);
+ Thread.sleep(sleepTime);
} catch (InterruptedException e) {
break;
}
@@ -215,8 +234,11 @@ public class PolicySession
@Override
public void afterMatchFired(AfterMatchFiredEvent event)
{
- logger.debug("afterMatchFired: " + getFullName()
- + ": AgendaEventListener.afterMatchFired(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("afterMatchFired: " + getFullName()
+ + ": AgendaEventListener.afterMatchFired(" + event + ")");
+ }
PdpJmx.getInstance().ruleFired();
}
@@ -226,8 +248,12 @@ public class PolicySession
@Override
public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event)
{
+ if (logger.isDebugEnabled())
+ {
logger.debug("afterRuleFlowGroupActivated: " + getFullName()
- + ": AgendaEventListener.afterRuleFlowGroupActivated(" + event + ")");
+ + ": AgendaEventListener.afterRuleFlowGroupActivated("
+ + event + ")");
+ }
}
/**
@@ -237,8 +263,12 @@ public class PolicySession
public void afterRuleFlowGroupDeactivated
(RuleFlowGroupDeactivatedEvent event)
{
- logger.debug("afterRuleFlowGroupDeactivated: " + getFullName()
- + ": AgendaEventListener.afterRuleFlowGroupDeactivated(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("afterRuleFlowGroupDeactivated: " + getFullName()
+ + ": AgendaEventListener.afterRuleFlowGroupDeactivated("
+ + event + ")");
+ }
}
/**
@@ -247,8 +277,12 @@ public class PolicySession
@Override
public void agendaGroupPopped(AgendaGroupPoppedEvent event)
{
- logger.debug("agendaGroupPopped: " + getFullName()
- + ": AgendaEventListener.agendaGroupPopped(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("agendaGroupPopped: " + getFullName()
+ + ": AgendaEventListener.agendaGroupPopped("
+ + event + ")");
+ }
}
/**
@@ -257,8 +291,12 @@ public class PolicySession
@Override
public void agendaGroupPushed(AgendaGroupPushedEvent event)
{
- logger.debug("agendaGroupPushed: " + getFullName()
- + ": AgendaEventListener.agendaGroupPushed(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("agendaGroupPushed: " + getFullName()
+ + ": AgendaEventListener.agendaGroupPushed("
+ + event + ")");
+ }
}
/**
@@ -267,8 +305,12 @@ public class PolicySession
@Override
public void beforeMatchFired(BeforeMatchFiredEvent event)
{
- logger.debug("beforeMatchFired: " + getFullName()
- + ": AgendaEventListener.beforeMatchFired(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("beforeMatchFired: " + getFullName()
+ + ": AgendaEventListener.beforeMatchFired("
+ + event + ")");
+ }
}
/**
@@ -278,8 +320,12 @@ public class PolicySession
public void beforeRuleFlowGroupActivated
(RuleFlowGroupActivatedEvent event)
{
- logger.debug("beforeRuleFlowGroupActivated: " + getFullName()
- + ": AgendaEventListener.beforeRuleFlowGroupActivated(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("beforeRuleFlowGroupActivated: " + getFullName()
+ + ": AgendaEventListener.beforeRuleFlowGroupActivated("
+ + event + ")");
+ }
}
/**
@@ -289,8 +335,12 @@ public class PolicySession
public void beforeRuleFlowGroupDeactivated
(RuleFlowGroupDeactivatedEvent event)
{
- logger.debug("beforeRuleFlowGroupDeactivated: " + getFullName()
- + ": AgendaEventListener.beforeRuleFlowGroupDeactivated(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("beforeRuleFlowGroupDeactivated: " + getFullName()
+ + ": AgendaEventListener.beforeRuleFlowGroupDeactivated("
+ + event + ")");
+ }
}
/**
@@ -299,8 +349,11 @@ public class PolicySession
@Override
public void matchCancelled(MatchCancelledEvent event)
{
- logger.debug("matchCancelled: " + getFullName()
- + ": AgendaEventListener.matchCancelled(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("matchCancelled: " + getFullName()
+ + ": AgendaEventListener.matchCancelled(" + event + ")");
+ }
}
/**
@@ -309,8 +362,11 @@ public class PolicySession
@Override
public void matchCreated(MatchCreatedEvent event)
{
- logger.debug("matchCreated: " + getFullName()
- + ": AgendaEventListener.matchCreated(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("matchCreated: " + getFullName()
+ + ": AgendaEventListener.matchCreated(" + event + ")");
+ }
}
/****************************************/
@@ -323,8 +379,11 @@ public class PolicySession
@Override
public void objectDeleted(ObjectDeletedEvent event)
{
- logger.debug("objectDeleted: " + getFullName()
- + ": AgendaEventListener.objectDeleted(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("objectDeleted: " + getFullName()
+ + ": AgendaEventListener.objectDeleted(" + event + ")");
+ }
}
/**
@@ -333,8 +392,11 @@ public class PolicySession
@Override
public void objectInserted(ObjectInsertedEvent event)
{
- logger.debug("objectInserted: " + getFullName()
- + ": AgendaEventListener.objectInserted(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("objectInserted: " + getFullName()
+ + ": AgendaEventListener.objectInserted(" + event + ")");
+ }
}
/**
@@ -343,7 +405,10 @@ public class PolicySession
@Override
public void objectUpdated(ObjectUpdatedEvent event)
{
- logger.debug("objectUpdated: " + getFullName()
- + ": AgendaEventListener.objectUpdated(" + event + ")");
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("objectUpdated: " + getFullName()
+ + ": AgendaEventListener.objectUpdated(" + event + ")");
+ }
}
}
diff --git a/policy-core/src/main/java/org/openecomp/policy/drools/core/FeatureAPI.java b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySessionFeatureAPI.java
index a14c6547..d5057696 100644
--- a/policy-core/src/main/java/org/openecomp/policy/drools/core/FeatureAPI.java
+++ b/policy-core/src/main/java/org/openecomp/policy/drools/core/PolicySessionFeatureAPI.java
@@ -20,10 +20,7 @@
package org.openecomp.policy.drools.core;
-import java.util.Properties;
-
import org.kie.api.runtime.KieSession;
-
import org.openecomp.policy.drools.utils.OrderedService;
import org.openecomp.policy.drools.utils.OrderedServiceImpl;
@@ -35,14 +32,14 @@ import org.openecomp.policy.drools.utils.OrderedServiceImpl;
* return a 'void' value. In other cases, such as 'activatePolicySession',
* may
*/
-public interface FeatureAPI extends OrderedService
+public interface PolicySessionFeatureAPI extends OrderedService
{
/**
* 'FeatureAPI.impl.getList()' returns an ordered list of objects
* implementing the 'FeatureAPI' interface.
*/
- static public OrderedServiceImpl<FeatureAPI> impl =
- new OrderedServiceImpl<FeatureAPI>(FeatureAPI.class);
+ static public OrderedServiceImpl<PolicySessionFeatureAPI> impl =
+ new OrderedServiceImpl<PolicySessionFeatureAPI>(PolicySessionFeatureAPI.class);
/**
* This method is called during initialization at a point right after
@@ -86,62 +83,6 @@ public interface FeatureAPI extends OrderedService
* 'KieSession'
*/
public void destroyKieSession(PolicySession policySession);
-
- /**
- * called before the Policy Engine is started
- */
- public void beforeStartEngine() throws IllegalStateException;
-
- /**
- * called immediately after the Policy Engine is started
- */
- public void afterStartEngine();
-
- /**
- * called before the Policy Engine is shut down
- */
- public void beforeShutdownEngine();
-
- /**
- * called after the Policy Engine is shut down
- */
- public void afterShutdownEngine();
-
- /**
- * called before creating a controller with name 'name'
- *
- * @param name name of the the controller
- * @param properties configuration properties
- */
- public void beforeCreateController(String name, Properties properties);
-
- /**
- * NOTE: temporary, should pass the Policy Controller already created
- *
- * called after creating a controller with name 'name'
- *
- * @param name name of the the controller
- * @param properties configuration properties
- */
- public void afterCreateController(String name);
-
- /**
- * NOTE: temporary, should pass the Policy Controller
- *
- * called before starting a controller with name 'name'
- *
- * @param name name of the the controller
- */
- public void beforeStartController(String name);
-
- /**
- * NOTE: temporary, should pass the Policy Controller
- *
- * called after starting a controller with name 'name'
- *
- * @param name name of the the controller
- */
- public void afterStartController(String name);
/**
* NOTE: this method is probably temporary
diff --git a/policy-core/src/main/java/org/openecomp/policy/drools/properties/PolicyProperties.java b/policy-core/src/main/java/org/openecomp/policy/drools/properties/PolicyProperties.java
index 13580219..1274e08c 100644
--- a/policy-core/src/main/java/org/openecomp/policy/drools/properties/PolicyProperties.java
+++ b/policy-core/src/main/java/org/openecomp/policy/drools/properties/PolicyProperties.java
@@ -46,6 +46,8 @@ public interface PolicyProperties {
public static final String PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX =".partitionKey";
+ public static final String PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX = ".selfSignedCertificates";
+
/* UEB Properties */
public static final String PROPERTY_UEB_SOURCE_TOPICS = "ueb.source.topics";
@@ -56,6 +58,21 @@ public interface PolicyProperties {
public static final String PROPERTY_DMAAP_SOURCE_TOPICS = "dmaap.source.topics";
public static final String PROPERTY_DMAAP_SINK_TOPICS = "dmaap.sink.topics";
+ public static final String PROPERTY_DMAAP_DME2_PARTNER_SUFFIX = ".dme2.partner";
+ public static final String PROPERTY_DMAAP_DME2_ROUTE_OFFER_SUFFIX = ".dme2.routeOffer";
+ public static final String PROPERTY_DMAAP_DME2_ENVIRONMENT_SUFFIX = ".dme2.environment";
+ public static final String PROPERTY_DMAAP_DME2_AFT_ENVIRONMENT_SUFFIX = ".dme2.aft.environment";
+ public static final String PROPERTY_DMAAP_DME2_LATITUDE_SUFFIX = ".dme2.latitude";
+ public static final String PROPERTY_DMAAP_DME2_LONGITUDE_SUFFIX = ".dme2.longitude";
+
+ public static final String PROPERTY_DMAAP_DME2_EP_READ_TIMEOUT_MS_SUFFIX = ".dme2.epReadTimeoutMs";
+ public static final String PROPERTY_DMAAP_DME2_EP_CONN_TIMEOUT_SUFFIX = ".dme2.epConnTimeout";
+ public static final String PROPERTY_DMAAP_DME2_ROUNDTRIP_TIMEOUT_MS_SUFFIX = ".dme2.roundtripTimeoutMs";
+ public static final String PROPERTY_DMAAP_DME2_VERSION_SUFFIX = ".dme2.version";
+ public static final String PROPERTY_DMAAP_DME2_SERVICE_NAME_SUFFIX = ".dme2.serviceName";
+ public static final String PROPERTY_DMAAP_DME2_SUB_CONTEXT_PATH_SUFFIX = ".dme2.subContextPath";
+ public static final String PROPERTY_DMAAP_DME2_SESSION_STICKINESS_REQUIRED_SUFFIX = ".dme2.sessionStickinessRequired";
+
/* HTTP Server Properties */
public static final String PROPERTY_HTTP_SERVER_SERVICES = "http.server.services";
diff --git a/policy-endpoints/pom.xml b/policy-endpoints/pom.xml
index 1fa1d8ed..cd79f6a7 100644
--- a/policy-endpoints/pom.xml
+++ b/policy-endpoints/pom.xml
@@ -37,11 +37,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
- <cambria.version>0.0.1</cambria.version>
- <dmaap.version>0.2.12</dmaap.version>
<jetty.version>9.3.14.v20161028</jetty.version>
- <jersey.version>2.22.1</jersey.version>
- <jackson.version>2.8.4</jackson.version>
</properties>
@@ -150,7 +146,7 @@
<dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-core</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
</dependencies>
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/TopicListener.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/TopicListener.java
index 7a2e9711..a3c2230d 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/TopicListener.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/TopicListener.java
@@ -31,12 +31,7 @@ public interface TopicListener {
* @param commType communication infrastructure type
* @param topic topic name
* @param event event message as a string
- *
- * @return boolean. True if the invoking event dispatcher should continue
- * dispatching the event to subsequent listeners. False if it is requested
- * to the invoking event dispatcher to stop dispatching the same event to
- * other listeners of less priority. This mechanism is generally not used.
*/
- public boolean onTopicEvent(Topic.CommInfrastructure commType, String topic, String event);
+ public void onTopicEvent(Topic.CommInfrastructure commType, String topic, String event);
}
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSinkFactory.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSinkFactory.java
index 5b4cfd42..c3d02d14 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSinkFactory.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSinkFactory.java
@@ -24,17 +24,64 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
-import org.openecomp.policy.drools.event.comm.bus.internal.InlineDmaapTopicSink;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+import org.openecomp.policy.drools.event.comm.bus.internal.InlineDmaapTopicSink;
import org.openecomp.policy.drools.properties.PolicyProperties;
/**
* DMAAP Topic Sink Factory
*/
public interface DmaapTopicSinkFactory {
+ public final String DME2_READ_TIMEOUT_PROPERTY = "AFT_DME2_EP_READ_TIMEOUT_MS";
+ public final String DME2_EP_CONN_TIMEOUT_PROPERTY = "AFT_DME2_EP_CONN_TIMEOUT";
+ public final String DME2_ROUNDTRIP_TIMEOUT_PROPERTY = "AFT_DME2_ROUNDTRIP_TIMEOUT_MS";
+ public final String DME2_VERSION_PROPERTY = "Version";
+ public final String DME2_ROUTE_OFFER_PROPERTY = "routeOffer";
+ public final String DME2_SERVICE_NAME_PROPERTY = "ServiceName";
+ public final String DME2_SUBCONTEXT_PATH_PROPERTY = "SubContextPath";
+ public final String DME2_SESSION_STICKINESS_REQUIRED_PROPERTY = "sessionstickinessrequired";
+
+ /**
+ * Instantiates a new DMAAP Topic Sink
+ *
+ * @param servers list of servers
+ * @param topic topic name
+ * @param apiKey API Key
+ * @param apiSecret API Secret
+ * @param userName AAF user name
+ * @param password AAF password
+ * @param partitionKey Consumer Group
+ * @param environment DME2 environment
+ * @param aftEnvironment DME2 AFT environment
+ * @param partner DME2 Partner
+ * @param latitude DME2 latitude
+ * @param longitude DME2 longitude
+ * @param additionalProps additional properties to pass to DME2
+ * @param managed is this sink endpoint managed?
+ *
+ * @return an DMAAP Topic Sink
+ * @throws IllegalArgumentException if invalid parameters are present
+ */
+ public DmaapTopicSink build(List<String> servers,
+ String topic,
+ String apiKey,
+ String apiSecret,
+ String userName,
+ String password,
+ String partitionKey,
+ String environment,
+ String aftEnvironment,
+ String partner,
+ String latitude,
+ String longitude,
+ Map<String,String> additionalProps,
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts) ;
/**
* Instantiates a new DMAAP Topic Sink
@@ -58,7 +105,9 @@ public interface DmaapTopicSinkFactory {
String userName,
String password,
String partitionKey,
- boolean managed)
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException;
/**
@@ -142,7 +191,15 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
String userName,
String password,
String partitionKey,
- boolean managed)
+ String environment,
+ String aftEnvironment,
+ String partner,
+ String latitude,
+ String longitude,
+ Map<String,String> additionalProps,
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException {
if (topic == null || topic.isEmpty()) {
@@ -158,7 +215,45 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
new InlineDmaapTopicSink(servers, topic,
apiKey, apiSecret,
userName, password,
- partitionKey);
+ partitionKey,
+ environment, aftEnvironment,
+ partner, latitude, longitude, additionalProps, useHttps, allowSelfSignedCerts);
+
+ if (managed)
+ dmaapTopicWriters.put(topic, dmaapTopicSink);
+ return dmaapTopicSink;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DmaapTopicSink build(List<String> servers,
+ String topic,
+ String apiKey,
+ String apiSecret,
+ String userName,
+ String password,
+ String partitionKey,
+ boolean managed,
+ boolean useHttps, boolean allowSelfSignedCerts)
+ throws IllegalArgumentException {
+
+ if (topic == null || topic.isEmpty()) {
+ throw new IllegalArgumentException("A topic must be provided");
+ }
+
+ synchronized (this) {
+ if (dmaapTopicWriters.containsKey(topic)) {
+ return dmaapTopicWriters.get(topic);
+ }
+
+ DmaapTopicSink dmaapTopicSink =
+ new InlineDmaapTopicSink(servers, topic,
+ apiKey, apiSecret,
+ userName, password,
+ partitionKey, useHttps, allowSelfSignedCerts);
if (managed)
dmaapTopicWriters.put(topic, dmaapTopicSink);
@@ -172,7 +267,7 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
*/
@Override
public DmaapTopicSink build(List<String> servers, String topic) throws IllegalArgumentException {
- return this.build(servers, topic, null, null, null, null, null, true);
+ return this.build(servers, topic, null, null, null, null, null, true, false, false);
}
@@ -196,12 +291,10 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
String servers = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." +
topic +
PolicyProperties.PROPERTY_TOPIC_SERVERS_SUFFIX);
- if (servers == null || servers.isEmpty()) {
- logger.error("No DMAAP servers provided in " + properties);
- continue;
- }
- List<String> serverList = new ArrayList<String>(Arrays.asList(servers.split("\\s*,\\s*")));
+ List<String> serverList;
+ if (servers != null && !servers.isEmpty()) serverList = new ArrayList<String>(Arrays.asList(servers.split("\\s*,\\s*")));
+ else serverList = new ArrayList<>();
String apiKey = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS +
"." + topic +
@@ -223,14 +316,100 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
String managedString = properties.getProperty(PolicyProperties.PROPERTY_UEB_SINK_TOPICS + "." + topic +
PolicyProperties.PROPERTY_MANAGED_SUFFIX);
+
+ /* DME2 Properties */
+
+ String dme2Environment = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ENVIRONMENT_SUFFIX);
+
+ String dme2AftEnvironment = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_AFT_ENVIRONMENT_SUFFIX);
+
+ String dme2Partner = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_PARTNER_SUFFIX);
+
+ String dme2RouteOffer = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_ROUTE_OFFER_SUFFIX);
+
+ String dme2Latitude = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_LATITUDE_SUFFIX);
+
+ String dme2Longitude = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_LONGITUDE_SUFFIX);
+
+ String dme2EpReadTimeoutMs = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_EP_READ_TIMEOUT_MS_SUFFIX);
+
+ String dme2EpConnTimeout = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_EP_CONN_TIMEOUT_SUFFIX);
+
+ String dme2RoundtripTimeoutMs = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS
+ + "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ROUNDTRIP_TIMEOUT_MS_SUFFIX);
+
+ String dme2Version = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_VERSION_SUFFIX);
+
+ String dme2SubContextPath = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_SUB_CONTEXT_PATH_SUFFIX);
+
+ String dme2SessionStickinessRequired = properties
+ .getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_SESSION_STICKINESS_REQUIRED_SUFFIX);
+
+ Map<String,String> dme2AdditionalProps = new HashMap<>();
+
+ if (dme2EpReadTimeoutMs != null && !dme2EpReadTimeoutMs.isEmpty())
+ dme2AdditionalProps.put(DME2_READ_TIMEOUT_PROPERTY, dme2EpReadTimeoutMs);
+ if (dme2EpConnTimeout != null && !dme2EpConnTimeout.isEmpty())
+ dme2AdditionalProps.put(DME2_EP_CONN_TIMEOUT_PROPERTY, dme2EpConnTimeout);
+ if (dme2RoundtripTimeoutMs != null && !dme2RoundtripTimeoutMs.isEmpty())
+ dme2AdditionalProps.put(DME2_ROUNDTRIP_TIMEOUT_PROPERTY, dme2RoundtripTimeoutMs);
+ if (dme2Version != null && !dme2Version.isEmpty())
+ dme2AdditionalProps.put(DME2_VERSION_PROPERTY, dme2Version);
+ if (dme2RouteOffer != null && !dme2RouteOffer.isEmpty())
+ dme2AdditionalProps.put(DME2_ROUTE_OFFER_PROPERTY, dme2RouteOffer);
+ if (dme2SubContextPath != null && !dme2SubContextPath.isEmpty())
+ dme2AdditionalProps.put(DME2_SUBCONTEXT_PATH_PROPERTY, dme2SubContextPath);
+ if (dme2SessionStickinessRequired != null && !dme2SessionStickinessRequired.isEmpty())
+ dme2AdditionalProps.put(DME2_SESSION_STICKINESS_REQUIRED_PROPERTY, dme2SessionStickinessRequired);
+
+ if (servers == null || servers.isEmpty()) {
+ logger.error("No DMaaP servers or DME2 ServiceName provided");
+ continue;
+ }
+
boolean managed = true;
if (managedString != null && !managedString.isEmpty()) {
managed = Boolean.parseBoolean(managedString);
}
+ String useHttpsString = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_HTTP_HTTPS_SUFFIX);
+
+ //default is to use HTTP if no https property exists
+ boolean useHttps = false;
+ if (useHttpsString != null && !useHttpsString.isEmpty()){
+ useHttps = Boolean.parseBoolean(useHttpsString);
+ }
+
+
+ String allowSelfSignedCertsString = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX);
+
+ //default is to disallow self-signed certs
+ boolean allowSelfSignedCerts = false;
+ if (allowSelfSignedCertsString != null && !allowSelfSignedCertsString.isEmpty()){
+ allowSelfSignedCerts = Boolean.parseBoolean(allowSelfSignedCertsString);
+ }
+
DmaapTopicSink dmaapTopicSink = this.build(serverList, topic,
- apiKey, apiSecret, aafMechId, aafPassword,
- partitionKey, managed);
+ apiKey, apiSecret,
+ aafMechId, aafPassword,
+ partitionKey,
+ dme2Environment, dme2AftEnvironment,
+ dme2Partner, dme2Latitude, dme2Longitude,
+ dme2AdditionalProps, managed, useHttps, allowSelfSignedCerts);
+
dmaapTopicWriters.add(dmaapTopicSink);
}
return dmaapTopicWriters;
@@ -305,4 +484,4 @@ class IndexedDmaapTopicSinkFactory implements DmaapTopicSinkFactory {
return writers;
}
-}
+} \ No newline at end of file
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java
index f8d85eb7..9f60556c 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/DmaapTopicSourceFactory.java
@@ -24,16 +24,26 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import org.openecomp.policy.drools.event.comm.bus.internal.SingleThreadedDmaapTopicSource;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
import org.openecomp.policy.drools.properties.PolicyProperties;
+
/**
* DMAAP Topic Source Factory
*/
public interface DmaapTopicSourceFactory {
+ public final String DME2_READ_TIMEOUT_PROPERTY = "AFT_DME2_EP_READ_TIMEOUT_MS";
+ public final String DME2_EP_CONN_TIMEOUT_PROPERTY = "AFT_DME2_EP_CONN_TIMEOUT";
+ public final String DME2_ROUNDTRIP_TIMEOUT_PROPERTY = "AFT_DME2_ROUNDTRIP_TIMEOUT_MS";
+ public final String DME2_VERSION_PROPERTY = "Version";
+ public final String DME2_ROUTE_OFFER_PROPERTY = "routeOffer";
+ public final String DME2_SERVICE_NAME_PROPERTY = "ServiceName";
+ public final String DME2_SUBCONTEXT_PATH_PROPERTY = "SubContextPath";
+ public final String DME2_SESSION_STICKINESS_REQUIRED_PROPERTY = "sessionstickinessrequired";
/**
* Creates an DMAAP Topic Source based on properties files
@@ -60,6 +70,8 @@ public interface DmaapTopicSourceFactory {
* @param fetchTimeout Read Fetch Timeout
* @param fetchLimit Fetch Limit
* @param managed is this endpoind managed?
+ * @param useHttps does the connection use HTTPS?
+ * @param allowSelfSignedCerts does connection allow self-signed certificates?
*
* @return an DMAAP Topic Source
* @throws IllegalArgumentException if invalid parameters are present
@@ -74,7 +86,56 @@ public interface DmaapTopicSourceFactory {
String consumerInstance,
int fetchTimeout,
int fetchLimit,
- boolean managed)
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
+ throws IllegalArgumentException;
+
+ /**
+ * Instantiates a new DMAAP Topic Source
+ *
+ * @param servers list of servers
+ * @param topic topic name
+ * @param apiKey API Key
+ * @param apiSecret API Secret
+ * @param userName user name
+ * @param password password
+ * @param consumerGroup Consumer Group
+ * @param consumerInstance Consumer Instance
+ * @param fetchTimeout Read Fetch Timeout
+ * @param fetchLimit Fetch Limit
+ * @param environment DME2 environment
+ * @param aftEnvironment DME2 AFT environment
+ * @param partner DME2 Partner
+ * @param latitude DME2 latitude
+ * @param longitude DME2 longitude
+ * @param additionalProps additional properties to pass to DME2
+ * @param managed is this endpoind managed?
+ * @param useHttps does the connection use HTTPS?
+ * @param allowSelfSignedCerts does connection allow self-signed certificates?
+ *
+ * @return an DMAAP Topic Source
+ * @throws IllegalArgumentException if invalid parameters are present
+ */
+ public DmaapTopicSource build(List<String> servers,
+ String topic,
+ String apiKey,
+ String apiSecret,
+ String userName,
+ String password,
+ String consumerGroup,
+ String consumerInstance,
+ int fetchTimeout,
+ int fetchLimit,
+ String environment,
+ String aftEnvironment,
+ String partner,
+ String latitude,
+ String longitude,
+ Map<String,String> additionalProps,
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException;
/**
@@ -104,7 +165,7 @@ public interface DmaapTopicSourceFactory {
* @return an DMAAP Topic Source
* @throws IllegalArgumentException if invalid parameters are present
*/
- public DmaapTopicSource build(List<String> servers,
+ public DmaapTopicSource build(List<String> servers,
String topic)
throws IllegalArgumentException;
@@ -154,7 +215,7 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
*/
protected HashMap<String, DmaapTopicSource> dmaapTopicSources =
new HashMap<String, DmaapTopicSource>();
-
+
/**
* {@inheritDoc}
*/
@@ -169,7 +230,15 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
String consumerInstance,
int fetchTimeout,
int fetchLimit,
- boolean managed)
+ String environment,
+ String aftEnvironment,
+ String partner,
+ String latitude,
+ String longitude,
+ Map<String,String> additionalProps,
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException {
if (topic == null || topic.isEmpty()) {
@@ -185,7 +254,53 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
new SingleThreadedDmaapTopicSource(servers, topic,
apiKey, apiSecret, userName, password,
consumerGroup, consumerInstance,
- fetchTimeout, fetchLimit);
+ fetchTimeout, fetchLimit,
+ environment, aftEnvironment, partner,
+ latitude, longitude, additionalProps, useHttps, allowSelfSignedCerts);
+
+ if (managed)
+ dmaapTopicSources.put(topic, dmaapTopicSource);
+
+ return dmaapTopicSource;
+ }
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DmaapTopicSource build(List<String> servers,
+ String topic,
+ String apiKey,
+ String apiSecret,
+ String userName,
+ String password,
+ String consumerGroup,
+ String consumerInstance,
+ int fetchTimeout,
+ int fetchLimit,
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
+ throws IllegalArgumentException {
+
+ if (servers == null || servers.isEmpty()) {
+ throw new IllegalArgumentException("DMaaP Server(s) must be provided");
+ }
+
+ if (topic == null || topic.isEmpty()) {
+ throw new IllegalArgumentException("A topic must be provided");
+ }
+
+ synchronized(this) {
+ if (dmaapTopicSources.containsKey(topic)) {
+ return dmaapTopicSources.get(topic);
+ }
+
+ DmaapTopicSource dmaapTopicSource =
+ new SingleThreadedDmaapTopicSource(servers, topic,
+ apiKey, apiSecret, userName, password,
+ consumerGroup, consumerInstance,
+ fetchTimeout, fetchLimit, useHttps,allowSelfSignedCerts);
if (managed)
dmaapTopicSources.put(topic, dmaapTopicSource);
@@ -216,12 +331,9 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
topic +
PolicyProperties.PROPERTY_TOPIC_SERVERS_SUFFIX);
- if (servers == null || servers.isEmpty()) {
- logger.error("No UEB servers provided in " + properties);
- continue;
- }
-
- List<String> serverList = new ArrayList<String>(Arrays.asList(servers.split("\\s*,\\s*")));
+ List<String> serverList;
+ if (servers != null && !servers.isEmpty()) serverList = new ArrayList<String>(Arrays.asList(servers.split("\\s*,\\s*")));
+ else serverList = new ArrayList<>();
String apiKey = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
"." + topic +
@@ -250,6 +362,70 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
String fetchTimeoutString = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
"." + topic +
PolicyProperties.PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX);
+
+ /* DME2 Properties */
+
+ String dme2Environment = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ENVIRONMENT_SUFFIX);
+
+ String dme2AftEnvironment = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_AFT_ENVIRONMENT_SUFFIX);
+
+ String dme2Partner = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_PARTNER_SUFFIX);
+
+ String dme2RouteOffer = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_ROUTE_OFFER_SUFFIX);
+
+ String dme2Latitude = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_LATITUDE_SUFFIX);
+
+ String dme2Longitude = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_LONGITUDE_SUFFIX);
+
+ String dme2EpReadTimeoutMs = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_EP_READ_TIMEOUT_MS_SUFFIX);
+
+ String dme2EpConnTimeout = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_EP_CONN_TIMEOUT_SUFFIX);
+
+ String dme2RoundtripTimeoutMs = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS
+ + "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ROUNDTRIP_TIMEOUT_MS_SUFFIX);
+
+ String dme2Version = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_VERSION_SUFFIX);
+
+ String dme2SubContextPath = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
+ + topic + PolicyProperties.PROPERTY_DMAAP_DME2_SUB_CONTEXT_PATH_SUFFIX);
+
+ String dme2SessionStickinessRequired = properties
+ .getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic
+ + PolicyProperties.PROPERTY_DMAAP_DME2_SESSION_STICKINESS_REQUIRED_SUFFIX);
+
+ Map<String,String> dme2AdditionalProps = new HashMap<>();
+
+ if (dme2EpReadTimeoutMs != null && !dme2EpReadTimeoutMs.isEmpty())
+ dme2AdditionalProps.put(DME2_READ_TIMEOUT_PROPERTY, dme2EpReadTimeoutMs);
+ if (dme2EpConnTimeout != null && !dme2EpConnTimeout.isEmpty())
+ dme2AdditionalProps.put(DME2_EP_CONN_TIMEOUT_PROPERTY, dme2EpConnTimeout);
+ if (dme2RoundtripTimeoutMs != null && !dme2RoundtripTimeoutMs.isEmpty())
+ dme2AdditionalProps.put(DME2_ROUNDTRIP_TIMEOUT_PROPERTY, dme2RoundtripTimeoutMs);
+ if (dme2Version != null && !dme2Version.isEmpty())
+ dme2AdditionalProps.put(DME2_VERSION_PROPERTY, dme2Version);
+ if (dme2RouteOffer != null && !dme2RouteOffer.isEmpty())
+ dme2AdditionalProps.put(DME2_ROUTE_OFFER_PROPERTY, dme2RouteOffer);
+ if (dme2SubContextPath != null && !dme2SubContextPath.isEmpty())
+ dme2AdditionalProps.put(DME2_SUBCONTEXT_PATH_PROPERTY, dme2SubContextPath);
+ if (dme2SessionStickinessRequired != null && !dme2SessionStickinessRequired.isEmpty())
+ dme2AdditionalProps.put(DME2_SESSION_STICKINESS_REQUIRED_PROPERTY, dme2SessionStickinessRequired);
+
+
+ if (servers == null || servers.isEmpty()) {
+
+ logger.error("No DMaaP servers or DME2 ServiceName provided");
+ continue;
+ }
+
int fetchTimeout = DmaapTopicSource.DEFAULT_TIMEOUT_MS_FETCH;
if (fetchTimeoutString != null && !fetchTimeoutString.isEmpty()) {
try {
@@ -279,10 +455,33 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
managed = Boolean.parseBoolean(managedString);
}
+ String useHttpsString = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_HTTP_HTTPS_SUFFIX);
+
+ //default is to use HTTP if no https property exists
+ boolean useHttps = false;
+ if (useHttpsString != null && !useHttpsString.isEmpty()){
+ useHttps = Boolean.parseBoolean(useHttpsString);
+ }
+
+ String allowSelfSignedCertsString = properties.getProperty(PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX);
+
+ //default is to disallow self-signed certs
+ boolean allowSelfSignedCerts = false;
+ if (allowSelfSignedCertsString != null && !allowSelfSignedCertsString.isEmpty()){
+ allowSelfSignedCerts = Boolean.parseBoolean(allowSelfSignedCertsString);
+ }
+
+
DmaapTopicSource uebTopicSource = this.build(serverList, topic,
apiKey, apiSecret, aafMechId, aafPassword,
consumerGroup, consumerInstance,
- fetchTimeout, fetchLimit, managed);
+ fetchTimeout, fetchLimit,
+ dme2Environment, dme2AftEnvironment, dme2Partner,
+ dme2Latitude, dme2Longitude, dme2AdditionalProps,
+ managed, useHttps, allowSelfSignedCerts);
+
dmaapTopicSource_s.add(uebTopicSource);
}
}
@@ -291,25 +490,29 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
/**
* {@inheritDoc}
+ * @throws IllegalArgumentException
*/
@Override
public DmaapTopicSource build(List<String> servers,
String topic,
String apiKey,
- String apiSecret) {
+ String apiSecret) throws IllegalArgumentException {
return this.build(servers, topic,
apiKey, apiSecret, null, null,
null, null,
DmaapTopicSource.DEFAULT_TIMEOUT_MS_FETCH,
DmaapTopicSource.DEFAULT_LIMIT_FETCH,
- true);
+ true,
+ false,
+ false);
}
/**
* {@inheritDoc}
+ * @throws IllegalArgumentException
*/
@Override
- public DmaapTopicSource build(List<String> servers, String topic) {
+ public DmaapTopicSource build(List<String> servers, String topic) throws IllegalArgumentException {
return this.build(servers, topic, null, null);
}
@@ -352,7 +555,7 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory {
if (dmaapTopicSources.containsKey(topic)) {
return dmaapTopicSources.get(topic);
} else {
- throw new IllegalArgumentException("DmaapTopicSource for " + topic + " not found");
+ throw new IllegalArgumentException("DmaapTopiceSource for " + topic + " not found");
}
}
}
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSinkFactory.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSinkFactory.java
index 85b98838..432f035c 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSinkFactory.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSinkFactory.java
@@ -54,7 +54,9 @@ public interface UebTopicSinkFactory {
String apiKey,
String apiSecret,
String partitionKey,
- boolean managed)
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException;
/**
@@ -135,9 +137,15 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
String apiKey,
String apiSecret,
String partitionKey,
- boolean managed)
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException {
+ if (servers == null || servers.isEmpty()) {
+ throw new IllegalArgumentException("UEB Server(s) must be provided");
+ }
+
if (topic == null || topic.isEmpty()) {
throw new IllegalArgumentException("A topic must be provided");
}
@@ -149,7 +157,7 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
UebTopicSink uebTopicWriter =
new InlineUebTopicSink(servers, topic,
- apiKey, apiSecret,partitionKey);
+ apiKey, apiSecret,partitionKey, useHttps, allowSelfSignedCerts);
if (managed)
uebTopicSinks.put(topic, uebTopicWriter);
@@ -164,7 +172,8 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
*/
@Override
public UebTopicSink build(List<String> servers, String topic) throws IllegalArgumentException {
- return this.build(servers, topic, null, null, null, true);
+
+ return this.build(servers, topic, null, null, null, true, false, false);
}
@@ -212,9 +221,28 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
managed = Boolean.parseBoolean(managedString);
}
+ String useHttpsString = properties.getProperty(PolicyProperties.PROPERTY_UEB_SOURCE_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_HTTP_HTTPS_SUFFIX);
+
+ //default is to use HTTP if no https property exists
+ boolean useHttps = false;
+ if (useHttpsString != null && !useHttpsString.isEmpty()){
+ useHttps = Boolean.parseBoolean(useHttpsString);
+ }
+
+
+ String allowSelfSignedCertsString = properties.getProperty(PolicyProperties.PROPERTY_UEB_SOURCE_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX);
+
+ //default is to disallow self-signed certs
+ boolean allowSelfSignedCerts = false;
+ if (allowSelfSignedCertsString != null && !allowSelfSignedCertsString.isEmpty()){
+ allowSelfSignedCerts = Boolean.parseBoolean(allowSelfSignedCertsString);
+ }
+
UebTopicSink uebTopicWriter = this.build(serverList, topic,
apiKey, apiSecret,
- partitionKey, managed);
+ partitionKey, managed, useHttps, allowSelfSignedCerts);
uebTopicWriters.add(uebTopicWriter);
}
return uebTopicWriters;
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSourceFactory.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSourceFactory.java
index bf2a4038..1729576f 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSourceFactory.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/UebTopicSourceFactory.java
@@ -71,7 +71,9 @@ public interface UebTopicSourceFactory {
String consumerInstance,
int fetchTimeout,
int fetchLimit,
- boolean managed)
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException;
/**
@@ -162,8 +164,13 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory {
String consumerInstance,
int fetchTimeout,
int fetchLimit,
- boolean managed)
+ boolean managed,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException {
+ if (servers == null || servers.isEmpty()) {
+ throw new IllegalArgumentException("UEB Server(s) must be provided");
+ }
if (topic == null || topic.isEmpty()) {
throw new IllegalArgumentException("A topic must be provided");
@@ -178,7 +185,7 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory {
new SingleThreadedUebTopicSource(servers, topic,
apiKey, apiSecret,
consumerGroup, consumerInstance,
- fetchTimeout, fetchLimit);
+ fetchTimeout, fetchLimit, useHttps, allowSelfSignedCerts);
if (managed)
uebTopicSources.put(topic, uebTopicSource);
@@ -263,10 +270,28 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory {
managed = Boolean.parseBoolean(managedString);
}
+ String useHttpsString = properties.getProperty(PolicyProperties.PROPERTY_UEB_SOURCE_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_HTTP_HTTPS_SUFFIX);
+
+ //default is to use HTTP if no https property exists
+ boolean useHttps = false;
+ if (useHttpsString != null && !useHttpsString.isEmpty()){
+ useHttps = Boolean.parseBoolean(useHttpsString);
+ }
+
+ String allowSelfSignedCertsString = properties.getProperty(PolicyProperties.PROPERTY_UEB_SOURCE_TOPICS + "." + topic +
+ PolicyProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX);
+
+ //default is to disallow self-signed certs
+ boolean allowSelfSignedCerts = false;
+ if (allowSelfSignedCertsString != null && !allowSelfSignedCertsString.isEmpty()){
+ allowSelfSignedCerts = Boolean.parseBoolean(allowSelfSignedCertsString);
+ }
+
UebTopicSource uebTopicSource = this.build(serverList, topic,
apiKey, apiSecret,
consumerGroup, consumerInstance,
- fetchTimeout, fetchLimit, managed);
+ fetchTimeout, fetchLimit, managed, useHttps, allowSelfSignedCerts);
uebTopicSources.add(uebTopicSource);
}
}
@@ -281,11 +306,12 @@ class IndexedUebTopicSourceFactory implements UebTopicSourceFactory {
String topic,
String apiKey,
String apiSecret) {
+
return this.build(servers, topic,
apiKey, apiSecret,
null, null,
UebTopicSource.DEFAULT_TIMEOUT_MS_FETCH,
- UebTopicSource.DEFAULT_LIMIT_FETCH, true);
+ UebTopicSource.DEFAULT_LIMIT_FETCH, true, false, true);
}
/**
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusConsumer.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusConsumer.java
index 6fee5ce0..a34d361b 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusConsumer.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusConsumer.java
@@ -22,12 +22,20 @@ package org.openecomp.policy.drools.event.comm.bus.internal;
import java.net.MalformedURLException;
import java.security.GeneralSecurityException;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
+import org.openecomp.policy.common.logging.eelf.PolicyLogger;
+import org.openecomp.policy.drools.event.comm.bus.DmaapTopicSinkFactory;
+import org.openecomp.policy.drools.properties.PolicyProperties;
+
import com.att.nsa.cambria.client.CambriaClientBuilders;
import com.att.nsa.cambria.client.CambriaConsumer;
+import com.att.nsa.mr.client.MRClientFactory;
import com.att.nsa.mr.client.impl.MRConsumerImpl;
+import com.att.nsa.mr.client.response.MRConsumerResponse;
import com.att.nsa.mr.test.clients.ProtocolTypeConstants;
import com.att.nsa.cambria.client.CambriaClientBuilders.ConsumerBuilder;
@@ -76,17 +84,40 @@ public interface BusConsumer {
public CambriaConsumerWrapper(List<String> servers, String topic,
String apiKey, String apiSecret,
String consumerGroup, String consumerInstance,
- int fetchTimeout, int fetchLimit)
+ int fetchTimeout, int fetchLimit, boolean useHttps, boolean useSelfSignedCerts)
throws IllegalArgumentException {
ConsumerBuilder builder =
new CambriaClientBuilders.ConsumerBuilder();
- builder.knownAs(consumerGroup, consumerInstance)
+
+ if (useHttps){
+
+ if(useSelfSignedCerts){
+ builder.knownAs(consumerGroup, consumerInstance)
+ .usingHosts(servers)
+ .onTopic(topic)
+ .waitAtServer(fetchTimeout)
+ .receivingAtMost(fetchLimit)
+ .usingHttps()
+ .allowSelfSignedCertificates();
+ }
+ else{
+ builder.knownAs(consumerGroup, consumerInstance)
+ .usingHosts(servers)
+ .onTopic(topic)
+ .waitAtServer(fetchTimeout)
+ .receivingAtMost(fetchLimit)
+ .usingHttps();
+ }
+ }
+ else{
+ builder.knownAs(consumerGroup, consumerInstance)
.usingHosts(servers)
.onTopic(topic)
.waitAtServer(fetchTimeout)
.receivingAtMost(fetchLimit);
+ }
if (apiKey != null && !apiKey.isEmpty() &&
apiSecret != null && !apiSecret.isEmpty()) {
@@ -123,8 +154,11 @@ public interface BusConsumer {
/**
* MR based consumer
*/
- public static class DmaapConsumerWrapper implements BusConsumer {
+ public abstract class DmaapConsumerWrapper implements BusConsumer {
+ protected int fetchTimeout;
+ protected Object closeCondition = new Object();
+
/**
* MR Consumer
*/
@@ -137,47 +171,75 @@ public interface BusConsumer {
* @param topic topic
* @param apiKey API Key
* @param apiSecret API Secret
- * @param aafLogin AAF Login
- * @param aafPassword AAF Password
+ * @param username AAF Login
+ * @param password AAF Password
* @param consumerGroup Consumer Group
* @param consumerInstance Consumer Instance
* @param fetchTimeout Fetch Timeout
* @param fetchLimit Fetch Limit
+ * @throws MalformedURLException
*/
+ @SuppressWarnings("unchecked")
public DmaapConsumerWrapper(List<String> servers, String topic,
String apiKey, String apiSecret,
- String aafLogin, String aafPassword,
+ String username, String password,
String consumerGroup, String consumerInstance,
- int fetchTimeout, int fetchLimit)
- throws Exception {
+ int fetchTimeout, int fetchLimit, boolean useHttps)
+
+ throws MalformedURLException {
+
+ this.fetchTimeout = fetchTimeout;
+
+ if (topic == null || topic.isEmpty()) {
+ throw new IllegalArgumentException("No topic for DMaaP");
+ }
this.consumer = new MRConsumerImpl(servers, topic,
consumerGroup, consumerInstance,
fetchTimeout, fetchLimit,
null, apiKey, apiSecret);
- this.consumer.setUsername(aafLogin);
- this.consumer.setPassword(aafPassword);
+ this.consumer.setUsername(username);
+ this.consumer.setPassword(password);
+
- this.consumer.setProtocolFlag(ProtocolTypeConstants.AAF_AUTH.getValue());
- Properties props = new Properties();
- props.setProperty("Protocol", "http");
- this.consumer.setProps(props);
- this.consumer.setHost(servers.get(0) + ":3904");;
}
/**
* {@inheritDoc}
*/
public Iterable<String> fetch() throws Exception {
- return this.consumer.fetch();
+ MRConsumerResponse response = this.consumer.fetchWithReturnConsumerResponse();
+
+ if (PolicyLogger.isDebugEnabled() && response != null)
+ PolicyLogger.debug(DmaapConsumerWrapper.class.getName(), "DMaaP consumer received " + response.getResponseCode() + ": " + response.getResponseMessage());
+
+ if (response.getResponseCode() == null || !response.getResponseCode().equals("200")) {
+ if (response.getResponseCode() == null)
+ PolicyLogger.error(DmaapConsumerWrapper.class.getName(), "DMaaP consumer received response code null");
+ else
+ PolicyLogger.error(DmaapConsumerWrapper.class.getName(), "DMaaP consumer received " + response.getResponseCode() + ": " + response.getResponseMessage());
+
+ synchronized (closeCondition) {
+ closeCondition.wait(fetchTimeout);
+ }
+ }
+
+ if (response.getActualMessages() == null)
+ return new ArrayList<String>();
+ else
+ return response.getActualMessages();
}
/**
* {@inheritDoc}
*/
public void close() {
+ synchronized (closeCondition) {
+ closeCondition.notifyAll();
+ }
+
this.consumer.close();
}
@@ -196,7 +258,181 @@ public interface BusConsumer {
}
}
+ /**
+ * MR based consumer
+ */
+ public static class DmaapAafConsumerWrapper extends DmaapConsumerWrapper {
+ private Properties props;
+
+ /**
+ * MR Consumer Wrapper
+ *
+ * @param servers messaging bus hosts
+ * @param topic topic
+ * @param apiKey API Key
+ * @param apiSecret API Secret
+ * @param aafLogin AAF Login
+ * @param aafPassword AAF Password
+ * @param consumerGroup Consumer Group
+ * @param consumerInstance Consumer Instance
+ * @param fetchTimeout Fetch Timeout
+ * @param fetchLimit Fetch Limit
+ * @throws MalformedURLException
+ */
+ public DmaapAafConsumerWrapper(List<String> servers, String topic,
+ String apiKey, String apiSecret,
+ String aafLogin, String aafPassword,
+ String consumerGroup, String consumerInstance,
+ int fetchTimeout, int fetchLimit, boolean useHttps) throws MalformedURLException {
+
+ super(servers, topic, apiKey, apiSecret,
+ aafLogin, aafPassword,
+ consumerGroup, consumerInstance,
+ fetchTimeout, fetchLimit, useHttps);
+
+ // super constructor sets servers = {""} if empty to avoid errors when using DME2
+ if ((servers.size() == 1 && servers.get(0).equals("")) ||
+ (servers == null) || (servers.size() == 0)) {
+ throw new IllegalArgumentException("Must provide at least one host for HTTP AAF");
+ }
+
+ this.consumer.setProtocolFlag(ProtocolTypeConstants.AAF_AUTH.getValue());
+
+ props = new Properties();
+
+ if(useHttps){
+ props.setProperty("Protocol", "https");
+ this.consumer.setHost(servers.get(0) + ":3905");
+
+ }
+ else{
+ props.setProperty("Protocol", "http");
+ this.consumer.setHost(servers.get(0) + ":3904");
+ }
+
+ this.consumer.setProps(props);
+ PolicyLogger.info(DmaapConsumerWrapper.class.getName(), "CREATION: " + this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ MRConsumerImpl consumer = (MRConsumerImpl) this.consumer;
+
+ builder.
+ append("DmaapConsumerWrapper [").
+ append("consumer.getAuthDate()=").append(consumer.getAuthDate()).
+ append(", consumer.getAuthKey()=").append(consumer.getAuthKey()).
+ append(", consumer.getHost()=").append(consumer.getHost()).
+ append(", consumer.getProtocolFlag()=").append(consumer.getProtocolFlag()).
+ append(", consumer.getUsername()=").append(consumer.getUsername()).
+ append("]");
+ return builder.toString();
+ }
+ }
+ public static class DmaapDmeConsumerWrapper extends DmaapConsumerWrapper {
+ private Properties props;
+
+ public DmaapDmeConsumerWrapper(List<String> servers, String topic,
+ String apiKey, String apiSecret,
+ String dme2Login, String dme2Password,
+ String consumerGroup, String consumerInstance,
+ int fetchTimeout, int fetchLimit,
+ String environment, String aftEnvironment, String dme2Partner,
+ String latitude, String longitude, Map<String,String> additionalProps, boolean useHttps) throws MalformedURLException {
+
+
+
+ super(servers, topic, apiKey, apiSecret,
+ dme2Login, dme2Password,
+ consumerGroup, consumerInstance,
+ fetchTimeout, fetchLimit, useHttps);
+
+
+ String dme2RouteOffer = additionalProps.get(DmaapTopicSinkFactory.DME2_ROUTE_OFFER_PROPERTY);
+
+ if (environment == null || environment.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ENVIRONMENT_SUFFIX + " property for DME2 in DMaaP");
+ } if (aftEnvironment == null || aftEnvironment.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_AFT_ENVIRONMENT_SUFFIX + " property for DME2 in DMaaP");
+ } if (latitude == null || latitude.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_LATITUDE_SUFFIX + " property for DME2 in DMaaP");
+ } if (longitude == null || longitude.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_LONGITUDE_SUFFIX + " property for DME2 in DMaaP");
+ }
+
+ if ((dme2Partner == null || dme2Partner.isEmpty()) && (dme2RouteOffer == null || dme2RouteOffer.isEmpty())) {
+ throw new IllegalArgumentException("Must provide at least " + PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_PARTNER_SUFFIX + " or " +
+ PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ROUTE_OFFER_SUFFIX + " for DME2");
+ }
+
+ String serviceName = servers.get(0);
+
+ this.consumer.setProtocolFlag(ProtocolTypeConstants.DME2.getValue());
+
+ this.consumer.setUsername(dme2Login);
+ this.consumer.setPassword(dme2Password);
+
+ props = new Properties();
+
+ props.setProperty(DmaapTopicSinkFactory.DME2_SERVICE_NAME_PROPERTY, serviceName);
+
+ props.setProperty("username", dme2Login);
+ props.setProperty("password", dme2Password);
+
+ /* These are required, no defaults */
+ props.setProperty("topic", topic);
+
+ props.setProperty("Environment", environment);
+ props.setProperty("AFT_ENVIRONMENT", aftEnvironment);
+
+ if (dme2Partner != null)
+ props.setProperty("Partner", dme2Partner);
+ if (dme2RouteOffer != null)
+ props.setProperty(DmaapTopicSinkFactory.DME2_ROUTE_OFFER_PROPERTY, dme2RouteOffer);
+
+ props.setProperty("Latitude", latitude);
+ props.setProperty("Longitude", longitude);
+
+ /* These are optional, will default to these values if not set in additionalProps */
+ props.setProperty("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
+ props.setProperty("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
+ props.setProperty("AFT_DME2_EP_CONN_TIMEOUT", "15000");
+ props.setProperty("Version", "1.0");
+ props.setProperty("SubContextPath", "/");
+ props.setProperty("sessionstickinessrequired", "no");
+
+ /* These should not change */
+ props.setProperty("TransportType", "DME2");
+ props.setProperty("MethodType", "GET");
+
+ if(useHttps){
+ props.setProperty("Protocol", "https");
+
+ }
+ else{
+ props.setProperty("Protocol", "http");
+ }
+
+ props.setProperty("contenttype", "application/json");
+
+ if (additionalProps != null) {
+ for(String key : additionalProps.keySet())
+ props.put(key, additionalProps.get(key));
+ }
+
+ MRClientFactory.prop = props;
+ this.consumer.setProps(props);
+
+ PolicyLogger.info(DmaapConsumerWrapper.class.getName(), "CREATION: " + this);
+ }
+ }
}
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusPublisher.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusPublisher.java
index 798bf989..b5595b2d 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusPublisher.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusPublisher.java
@@ -24,14 +24,20 @@ import java.net.MalformedURLException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.openecomp.policy.common.logging.eelf.PolicyLogger;
+import org.openecomp.policy.drools.event.comm.bus.DmaapTopicSinkFactory;
+import org.openecomp.policy.drools.properties.PolicyProperties;
+import org.slf4j.LoggerFactory;
+
import com.att.nsa.cambria.client.CambriaBatchingPublisher;
import com.att.nsa.cambria.client.CambriaClientBuilders;
import com.att.nsa.cambria.client.CambriaClientBuilders.PublisherBuilder;
import com.att.nsa.mr.client.impl.MRSimplerBatchPublisher;
+import com.att.nsa.mr.client.response.MRPublisherResponse;
import com.att.nsa.mr.test.clients.ProtocolTypeConstants;
import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -65,15 +71,21 @@ public interface BusPublisher {
public CambriaPublisherWrapper(List<String> servers, String topic,
String apiKey,
- String apiSecret)
- throws IllegalArgumentException {
+ String apiSecret, boolean useHttps) throws IllegalArgumentException {
PublisherBuilder builder = new CambriaClientBuilders.PublisherBuilder();
-
- builder.usingHosts(servers)
+
+
+ if (useHttps){
+
+ builder.usingHosts(servers)
+ .onTopic(topic)
+ .usingHttps();
+ }
+ else{
+ builder.usingHosts(servers)
.onTopic(topic);
-
- // Only supported in 0.2.4 version
- // .logSendFailuresAfter(DEFAULT_LOG_SEND_FAILURES_AFTER);
+ }
+
if (apiKey != null && !apiKey.isEmpty() &&
apiSecret != null && !apiSecret.isEmpty()) {
@@ -142,43 +154,105 @@ public interface BusPublisher {
/**
* DmaapClient library wrapper
*/
- public static class DmaapPublisherWrapper implements BusPublisher {
+ public abstract class DmaapPublisherWrapper implements BusPublisher {
/**
* MR based Publisher
*/
protected MRSimplerBatchPublisher publisher;
+ protected Properties props;
- public DmaapPublisherWrapper(List<String> servers, String topic,
- String aafLogin,
- String aafPassword) {
+ /**
+ * MR Publisher Wrapper
+ *
+ * @param servers messaging bus hosts
+ * @param topic topic
+ * @param username AAF or DME2 Login
+ * @param password AAF or DME2 Password
+ */
+ public DmaapPublisherWrapper(ProtocolTypeConstants protocol,
+ List<String> servers, String topic,
+ String username,
+ String password, boolean useHttps) throws IllegalArgumentException {
+
- ArrayList<String> dmaapServers = new ArrayList<String>();
- for (String server: servers) {
- dmaapServers.add(server + ":3904");
+ if (topic == null || topic.isEmpty()) {
+ throw new IllegalArgumentException("No topic for DMaaP");
}
-
- this.publisher =
- new MRSimplerBatchPublisher.Builder().
- againstUrls(dmaapServers).
- onTopic(topic).
- build();
- this.publisher.setProtocolFlag(ProtocolTypeConstants.AAF_AUTH.getValue());
+ if (protocol == ProtocolTypeConstants.AAF_AUTH) {
+ if (servers == null || servers.isEmpty())
+ throw new IllegalArgumentException("No DMaaP servers or DME2 partner provided");
+
+ ArrayList<String> dmaapServers = new ArrayList<String>();
+ if(useHttps){
+ for (String server: servers) {
+ dmaapServers.add(server + ":3905");
+ }
+
+ }
+ else{
+ for (String server: servers) {
+ dmaapServers.add(server + ":3904");
+ }
+ }
+
+
+ this.publisher =
+ new MRSimplerBatchPublisher.Builder().
+ againstUrls(dmaapServers).
+ onTopic(topic).
+ build();
+
+ this.publisher.setProtocolFlag(ProtocolTypeConstants.AAF_AUTH.getValue());
+ } else if (protocol == ProtocolTypeConstants.DME2) {
+ ArrayList<String> dmaapServers = new ArrayList<String>();
+ dmaapServers.add("0.0.0.0:3904");
+
+ this.publisher =
+ new MRSimplerBatchPublisher.Builder().
+ againstUrls(dmaapServers).
+ onTopic(topic).
+ build();
+
+ this.publisher.setProtocolFlag(ProtocolTypeConstants.DME2.getValue());
+
+ }
+
+ this.publisher.logTo(LoggerFactory.getLogger(MRSimplerBatchPublisher.class.getName()));
- this.publisher.setUsername(aafLogin);
- this.publisher.setPassword(aafPassword);
+ this.publisher.setUsername(username);
+ this.publisher.setPassword(password);
- Properties props = new Properties();
- props.setProperty("Protocol", "http");
+ props = new Properties();
+
+ if(useHttps){
+
+ props.setProperty("Protocol", "https");
+ }
+ else{
+
+ props.setProperty("Protocol", "http");
+
+ }
+
props.setProperty("contenttype", "application/json");
+ props.setProperty("username", username);
+ props.setProperty("password", password);
+
+ props.setProperty("topic", topic);
this.publisher.setProps(props);
- this.publisher.setHost(servers.get(0));
+ if (protocol == ProtocolTypeConstants.AAF_AUTH)
+ this.publisher.setHost(servers.get(0));
- if (PolicyLogger.isInfoEnabled())
+ if (PolicyLogger.isInfoEnabled()) {
PolicyLogger.info(DmaapPublisherWrapper.class.getName(),
"CREATION: " + this);
+ PolicyLogger.info(DmaapPublisherWrapper.class.getName(),
+ "BusPublisher.DmaapPublisherWrapper using Protocol: " + protocol.getValue());
+ }
+
}
/**
@@ -208,7 +282,16 @@ public interface BusPublisher {
if (message == null)
throw new IllegalArgumentException("No message provided");
+ this.publisher.setPubResponse(new MRPublisherResponse());
this.publisher.send(partitionId, message);
+ MRPublisherResponse response = this.publisher.sendBatchWithResponse();
+ if (PolicyLogger.isDebugEnabled() && response != null) {
+ PolicyLogger.debug(DmaapPublisherWrapper.class.getName(),
+ "DMaaP publisher received " + response.getResponseCode() + ": "
+ + response.getResponseMessage());
+
+ }
+
return true;
}
@@ -227,5 +310,97 @@ public interface BusPublisher {
return builder.toString();
}
}
+
+ /**
+ * DmaapClient library wrapper
+ */
+ public static class DmaapAafPublisherWrapper extends DmaapPublisherWrapper {
+ /**
+ * MR based Publisher
+ */
+ protected MRSimplerBatchPublisher publisher;
+
+ public DmaapAafPublisherWrapper(List<String> servers, String topic,
+ String aafLogin,
+ String aafPassword, boolean useHttps) {
+
+ super(ProtocolTypeConstants.AAF_AUTH, servers, topic, aafLogin, aafPassword, useHttps);
+ }
+ }
+
+ public static class DmaapDmePublisherWrapper extends DmaapPublisherWrapper {
+ public DmaapDmePublisherWrapper(List<String> servers, String topic,
+ String username, String password,
+ String environment, String aftEnvironment, String dme2Partner,
+ String latitude, String longitude, Map<String,String> additionalProps, boolean useHttps) {
+
+ super(ProtocolTypeConstants.DME2, servers, topic, username, password, useHttps);
+
+
+
+
+
+
+ String dme2RouteOffer = additionalProps.get(DmaapTopicSinkFactory.DME2_ROUTE_OFFER_PROPERTY);
+
+ if (environment == null || environment.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ENVIRONMENT_SUFFIX + " property for DME2 in DMaaP");
+ } if (aftEnvironment == null || aftEnvironment.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_AFT_ENVIRONMENT_SUFFIX + " property for DME2 in DMaaP");
+ } if (latitude == null || latitude.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_LATITUDE_SUFFIX + " property for DME2 in DMaaP");
+ } if (longitude == null || longitude.isEmpty()) {
+ throw new IllegalArgumentException("Missing " + PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_LONGITUDE_SUFFIX + " property for DME2 in DMaaP");
+ }
+
+ if ((dme2Partner == null || dme2Partner.isEmpty()) && (dme2RouteOffer == null || dme2RouteOffer.isEmpty())) {
+ throw new IllegalArgumentException("Must provide at least " + PolicyProperties.PROPERTY_DMAAP_SOURCE_TOPICS +
+ "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_PARTNER_SUFFIX + " or " +
+ PolicyProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + topic + PolicyProperties.PROPERTY_DMAAP_DME2_ROUTE_OFFER_SUFFIX + " for DME2");
+ }
+
+ String serviceName = servers.get(0);
+
+ /* These are required, no defaults */
+ props.setProperty("Environment", environment);
+ props.setProperty("AFT_ENVIRONMENT", aftEnvironment);
+
+ props.setProperty(DmaapTopicSinkFactory.DME2_SERVICE_NAME_PROPERTY, serviceName);
+ if (dme2Partner != null)
+ props.setProperty("Partner", dme2Partner);
+ if (dme2RouteOffer != null)
+ props.setProperty(DmaapTopicSinkFactory.DME2_ROUTE_OFFER_PROPERTY, dme2RouteOffer);
+
+ props.setProperty("Latitude", latitude);
+ props.setProperty("Longitude", longitude);
+
+ // ServiceName also a default, found in additionalProps
+
+ /* These are optional, will default to these values if not set in optionalProps */
+ props.setProperty("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
+ props.setProperty("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
+ props.setProperty("AFT_DME2_EP_CONN_TIMEOUT", "15000");
+ props.setProperty("Version", "1.0");
+ props.setProperty("SubContextPath", "/");
+ props.setProperty("sessionstickinessrequired", "no");
+
+ /* These should not change */
+ props.setProperty("TransportType", "DME2");
+ props.setProperty("MethodType", "POST");
+
+ for (String key : additionalProps.keySet()) {
+ String value = additionalProps.get(key);
+
+ if (value != null)
+ props.setProperty(key, value);
+ }
+
+ this.publisher.setProps(props);
+ }
+ }
}
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusTopicBase.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusTopicBase.java
index e36e3afc..4ac1c6fc 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusTopicBase.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/BusTopicBase.java
@@ -23,7 +23,6 @@ package org.openecomp.policy.drools.event.comm.bus.internal;
import java.util.List;
import org.apache.commons.collections4.queue.CircularFifoQueue;
-
import org.openecomp.policy.drools.event.comm.Topic;
import org.openecomp.policy.drools.event.comm.bus.BusTopic;
@@ -35,13 +34,30 @@ public abstract class BusTopicBase implements BusTopic, Topic {
protected String apiKey;
protected String apiSecret;
+ protected boolean useHttps;
+ protected boolean allowSelfSignedCerts;
protected CircularFifoQueue<String> recentEvents = new CircularFifoQueue<String>(10);
+ /**
+ * Instantiates a new Bus Topic Base
+ *
+ * @param servers list of servers
+ * @param topic topic name
+ * @param apiKey API Key
+ * @param apiSecret API Secret
+ * @param useHttps does connection use HTTPS?
+ * @param allowSelfSignedCerts are self-signed certificates allow
+ *
+ * @return a Bus Topic Base
+ * @throws IllegalArgumentException if invalid parameters are present
+ */
public BusTopicBase(List<String> servers,
String topic,
String apiKey,
- String apiSecret)
+ String apiSecret,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException {
if (servers == null || servers.isEmpty()) {
@@ -57,6 +73,8 @@ public abstract class BusTopicBase implements BusTopic, Topic {
this.apiKey = apiKey;
this.apiSecret = apiSecret;
+ this.useHttps = useHttps;
+ this.allowSelfSignedCerts = allowSelfSignedCerts;
}
/**
@@ -92,6 +110,20 @@ public abstract class BusTopicBase implements BusTopic, Topic {
}
/**
+ * @return useHttps
+ */
+ public boolean isUseHttps(){
+ return useHttps;
+ }
+
+ /**
+ * @return allowSelfSignedCerts
+ */
+ public boolean isAllowSelfSignedCerts(){
+ return allowSelfSignedCerts;
+ }
+
+ /**
* @return the recentEvents
*/
@Override
@@ -104,8 +136,13 @@ public abstract class BusTopicBase implements BusTopic, Topic {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
- builder.append("UebTopicBase [servers=").append(servers).append(", topic=").append(topic).append(", apiKey=")
- .append(apiKey).append(", apiSecret=").append(apiSecret).append("]");
+ builder.append("UebTopicBase [servers=").append(servers)
+ .append(", topic=").append(topic)
+ .append(", apiKey=").append(apiKey)
+ .append(", apiSecret=").append(apiSecret)
+ .append(", useHttps=").append(useHttps)
+ .append(", allowSelfSignedCerts=").append(allowSelfSignedCerts)
+ .append("]");
return builder.toString();
}
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineBusTopicSink.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineBusTopicSink.java
index bd88818b..a78de716 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineBusTopicSink.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineBusTopicSink.java
@@ -83,13 +83,15 @@ public abstract class InlineBusTopicSink extends BusTopicBase implements BusTopi
* @param apiKey api secret
* @param apiSecret api secret
* @param partitionId partition id
+ * @param useHttps does connection use HTTPS?
+ * @param allowSelfSignedCerts are self-signed certificates allow
* @throws IllegalArgumentException in invalid parameters are passed in
*/
public InlineBusTopicSink(List<String> servers, String topic,
- String apiKey, String apiSecret, String partitionId)
+ String apiKey, String apiSecret, String partitionId, boolean useHttps, boolean allowSelfSignedCerts)
throws IllegalArgumentException {
- super(servers, topic, apiKey, apiSecret);
+ super(servers, topic, apiKey, apiSecret, useHttps, allowSelfSignedCerts);
if (partitionId == null || partitionId.isEmpty()) {
this.partitionId = UUID.randomUUID ().toString();
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineDmaapTopicSink.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineDmaapTopicSink.java
index 417c6d47..f5a3dc11 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineDmaapTopicSink.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineDmaapTopicSink.java
@@ -21,11 +21,12 @@
package org.openecomp.policy.drools.event.comm.bus.internal;
import java.util.List;
+import java.util.Map;
-import org.openecomp.policy.drools.event.comm.Topic;
-import org.openecomp.policy.drools.event.comm.bus.DmaapTopicSink;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+import org.openecomp.policy.drools.event.comm.Topic;
+import org.openecomp.policy.drools.event.comm.bus.DmaapTopicSink;
/**
* This implementation publishes events for the associated DMAAP topic,
@@ -39,13 +40,68 @@ public class InlineDmaapTopicSink extends InlineBusTopicSink implements DmaapTop
protected final String userName;
protected final String password;
+ protected String environment = null;
+ protected String aftEnvironment = null;
+ protected String partner = null;
+ protected String latitude = null;
+ protected String longitude = null;
+
+ protected Map<String,String> additionalProps = null;
+
+ /**
+ *
+ * @param servers DMaaP servers
+ * @param topic DMaaP Topic to be monitored
+ * @param apiKey DMaaP API Key (optional)
+ * @param apiSecret DMaaP API Secret (optional)
+ * @param consumerGroup DMaaP Reader Consumer Group
+ * @param consumerInstance DMaaP Reader Instance
+ * @param fetchTimeout DMaaP fetch timeout
+ * @param fetchLimit DMaaP fetch limit
+ * @param environment DME2 Environment
+ * @param aftEnvironment DME2 AFT Environment
+ * @param partner DME2 Partner
+ * @param latitude DME2 Latitude
+ * @param longitude DME2 Longitude
+ * @param additionalProps Additional properties to pass to DME2
+ * @param useHttps does connection use HTTPS?
+ * @param allowSelfSignedCerts are self-signed certificates allow
+ *
+ * @throws IllegalArgumentException An invalid parameter passed in
+ */
+ public InlineDmaapTopicSink(List<String> servers, String topic,
+ String apiKey, String apiSecret,
+ String userName, String password,
+ String partitionKey,
+ String environment, String aftEnvironment, String partner,
+ String latitude, String longitude, Map<String,String> additionalProps,
+ boolean useHttps, boolean allowSelfSignedCerts)
+ throws IllegalArgumentException {
+
+ super(servers, topic, apiKey, apiSecret, partitionKey, useHttps, allowSelfSignedCerts);
+
+ this.userName = userName;
+ this.password = password;
+
+ this.environment = environment;
+ this.aftEnvironment = aftEnvironment;
+ this.partner = partner;
+
+ this.latitude = latitude;
+ this.longitude = longitude;
+
+ this.additionalProps = additionalProps;
+
+ this.init();
+ }
+
public InlineDmaapTopicSink(List<String> servers, String topic,
String apiKey, String apiSecret,
String userName, String password,
- String partitionKey)
+ String partitionKey, boolean useHttps, boolean allowSelfSignedCerts)
throws IllegalArgumentException {
- super(servers, topic, apiKey, apiSecret, partitionKey);
+ super(servers, topic, apiKey, apiSecret, partitionKey, useHttps, allowSelfSignedCerts);
this.userName = userName;
this.password = password;
@@ -54,11 +110,24 @@ public class InlineDmaapTopicSink extends InlineBusTopicSink implements DmaapTop
@Override
public void init() {
- this.publisher =
- new BusPublisher.DmaapPublisherWrapper(this.servers,
+ if ((this.environment == null || this.environment.isEmpty()) &&
+ (this.aftEnvironment == null || this.aftEnvironment.isEmpty()) &&
+ (this.latitude == null || this.latitude.isEmpty()) &&
+ (this.longitude == null || this.longitude.isEmpty()) &&
+ (this.partner == null || this.partner.isEmpty())) {
+ this.publisher =
+ new BusPublisher.DmaapAafPublisherWrapper(this.servers,
this.topic,
this.userName,
- this.password);
+ this.password, this.useHttps);
+ } else {
+ this.publisher =
+ new BusPublisher.DmaapDmePublisherWrapper(this.servers, this.topic,
+ this.userName, this.password,
+ this.environment, this.aftEnvironment,
+ this.partner, this.latitude, this.longitude,
+ this.additionalProps, this.useHttps);
+ }
if (logger.isInfoEnabled())
logger.info("DMAAP SINK TOPIC created " + this);
}
@@ -81,4 +150,4 @@ public class InlineDmaapTopicSink extends InlineBusTopicSink implements DmaapTop
return builder.toString();
}
-}
+} \ No newline at end of file
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineUebTopicSink.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineUebTopicSink.java
index 2d4b1552..c93e0f2b 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineUebTopicSink.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/InlineUebTopicSink.java
@@ -46,6 +46,8 @@ public class InlineUebTopicSink extends InlineBusTopicSink implements UebTopicSi
* @param apiKey the api key (optional)
* @param apiSecret the api secret (optional)
* @param partitionId the partition key (optional, autogenerated if not provided)
+ * @param useHttps does connection use HTTPS?
+ * @param allowSelfSignedCerts are self-signed certificates allow
*
* @throws IllegalArgumentException if invalid arguments are detected
*/
@@ -53,9 +55,11 @@ public class InlineUebTopicSink extends InlineBusTopicSink implements UebTopicSi
String topic,
String apiKey,
String apiSecret,
- String partitionId)
+ String partitionId,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException {
- super(servers, topic, apiKey, apiSecret, partitionId);
+ super(servers, topic, apiKey, apiSecret, partitionId, useHttps, allowSelfSignedCerts);
}
/**
@@ -68,7 +72,8 @@ public class InlineUebTopicSink extends InlineBusTopicSink implements UebTopicSi
new BusPublisher.CambriaPublisherWrapper(this.servers,
this.topic,
this.apiKey,
- this.apiSecret);
+ this.apiSecret,
+ this.useHttps);
if (logger.isInfoEnabled())
logger.info("UEB SINK TOPIC created " + this);
}
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java
index f37c349e..d3be9163 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedBusTopicSource.java
@@ -98,6 +98,7 @@ public abstract class SingleThreadedBusTopicSource
*/
protected final ArrayList<TopicListener> topicListeners = new ArrayList<TopicListener>();
+
/**
*
* @param servers Bus servers
@@ -108,6 +109,8 @@ public abstract class SingleThreadedBusTopicSource
* @param consumerInstance Bus Reader Instance
* @param fetchTimeout Bus fetch timeout
* @param fetchLimit Bus fetch limit
+ * @param useHttps does the bus use https
+ * @param allowSelfSignedCerts are self-signed certificates allowed
* @throws IllegalArgumentException An invalid parameter passed in
*/
public SingleThreadedBusTopicSource(List<String> servers,
@@ -117,10 +120,12 @@ public abstract class SingleThreadedBusTopicSource
String consumerGroup,
String consumerInstance,
int fetchTimeout,
- int fetchLimit)
+ int fetchLimit,
+ boolean useHttps,
+ boolean allowSelfSignedCerts)
throws IllegalArgumentException {
- super(servers, topic, apiKey, apiSecret);
+ super(servers, topic, apiKey, apiSecret, useHttps, allowSelfSignedCerts);
if (consumerGroup == null || consumerGroup.isEmpty()) {
this.consumerGroup = UUID.randomUUID ().toString();
@@ -145,6 +150,7 @@ public abstract class SingleThreadedBusTopicSource
} else {
this.fetchLimit = fetchLimit;
}
+
}
/**
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java
index e65d44a7..2ced5bcb 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedDmaapTopicSource.java
@@ -21,10 +21,11 @@
package org.openecomp.policy.drools.event.comm.bus.internal;
import java.util.List;
+import java.util.Map;
+import org.openecomp.policy.common.logging.eelf.PolicyLogger;
import org.openecomp.policy.drools.event.comm.Topic;
import org.openecomp.policy.drools.event.comm.bus.DmaapTopicSource;
-import org.openecomp.policy.common.logging.eelf.PolicyLogger;
/**
* This topic reader implementation specializes in reading messages
@@ -33,10 +34,21 @@ import org.openecomp.policy.common.logging.eelf.PolicyLogger;
public class SingleThreadedDmaapTopicSource extends SingleThreadedBusTopicSource
implements DmaapTopicSource, Runnable {
+
+ protected boolean allowSelfSignedCerts;
protected final String userName;
protected final String password;
private String className = SingleThreadedDmaapTopicSource.class.getName();
+
+ protected String environment = null;
+ protected String aftEnvironment = null;
+ protected String partner = null;
+ protected String latitude = null;
+ protected String longitude = null;
+
+ protected Map<String,String> additionalProps = null;
+
/**
*
* @param servers DMaaP servers
@@ -47,19 +59,75 @@ public class SingleThreadedDmaapTopicSource extends SingleThreadedBusTopicSource
* @param consumerInstance DMaaP Reader Instance
* @param fetchTimeout DMaaP fetch timeout
* @param fetchLimit DMaaP fetch limit
+ * @param environment DME2 Environment
+ * @param aftEnvironment DME2 AFT Environment
+ * @param partner DME2 Partner
+ * @param latitude DME2 Latitude
+ * @param longitude DME2 Longitude
+ * @param additionalProps Additional properties to pass to DME2
+ * @param useHttps does connection use HTTPS?
+ * @param allowSelfSignedCerts are self-signed certificates allow
+ *
+ * @throws IllegalArgumentException An invalid parameter passed in
+ */
+ public SingleThreadedDmaapTopicSource(List<String> servers, String topic,
+ String apiKey, String apiSecret,
+ String userName, String password,
+ String consumerGroup, String consumerInstance,
+ int fetchTimeout, int fetchLimit,
+ String environment, String aftEnvironment, String partner,
+ String latitude, String longitude, Map<String,String> additionalProps,
+ boolean useHttps, boolean allowSelfSignedCerts)
+ throws IllegalArgumentException {
+
+ super(servers, topic, apiKey, apiSecret,
+ consumerGroup, consumerInstance,
+ fetchTimeout, fetchLimit, useHttps,allowSelfSignedCerts);
+
+ this.userName = userName;
+ this.password = password;
+
+ this.environment = environment;
+ this.aftEnvironment = aftEnvironment;
+ this.partner = partner;
+
+ this.latitude = latitude;
+ this.longitude = longitude;
+
+ this.additionalProps = additionalProps;
+ try {
+ this.init();
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ /**
+ *
+ * @param servers DMaaP servers
+ * @param topic DMaaP Topic to be monitored
+ * @param apiKey DMaaP API Key (optional)
+ * @param apiSecret DMaaP API Secret (optional)
+ * @param consumerGroup DMaaP Reader Consumer Group
+ * @param consumerInstance DMaaP Reader Instance
+ * @param fetchTimeout DMaaP fetch timeout
+ * @param fetchLimit DMaaP fetch limit
+ * @param useHttps does connection use HTTPS?
+ * @param allowSelfSignedCerts are self-signed certificates allow
* @throws IllegalArgumentException An invalid parameter passed in
*/
public SingleThreadedDmaapTopicSource(List<String> servers, String topic,
String apiKey, String apiSecret,
String userName, String password,
String consumerGroup, String consumerInstance,
- int fetchTimeout, int fetchLimit)
+ int fetchTimeout, int fetchLimit, boolean useHttps, boolean allowSelfSignedCerts)
throws IllegalArgumentException {
super(servers, topic, apiKey, apiSecret,
consumerGroup, consumerInstance,
- fetchTimeout, fetchLimit);
+ fetchTimeout, fetchLimit, useHttps, allowSelfSignedCerts);
this.userName = userName;
this.password = password;
@@ -78,22 +146,35 @@ public class SingleThreadedDmaapTopicSource extends SingleThreadedBusTopicSource
*/
@Override
public void init() throws Exception {
-
if (this.userName == null || this.userName.isEmpty() ||
- this.password == null || this.password.isEmpty()) {
- this.consumer =
- new BusConsumer.CambriaConsumerWrapper(this.servers, this.topic,
- this.apiKey, this.apiSecret,
- this.consumerGroup, this.consumerInstance,
- this.fetchTimeout, this.fetchLimit);
- } else {
- this.consumer =
- new BusConsumer.DmaapConsumerWrapper(this.servers, this.topic,
- this.apiKey, this.apiSecret,
- this.userName, this.password,
- this.consumerGroup, this.consumerInstance,
- this.fetchTimeout, this.fetchLimit);
- }
+ this.password == null || this.password.isEmpty()) {
+ this.consumer =
+ new BusConsumer.CambriaConsumerWrapper(this.servers, this.topic,
+ this.apiKey, this.apiSecret,
+ this.consumerGroup, this.consumerInstance,
+ this.fetchTimeout, this.fetchLimit,
+ this.useHttps, this.allowSelfSignedCerts);
+ } else if ((this.environment == null || this.environment.isEmpty()) &&
+ (this.aftEnvironment == null || this.aftEnvironment.isEmpty()) &&
+ (this.latitude == null || this.latitude.isEmpty()) &&
+ (this.longitude == null || this.longitude.isEmpty()) &&
+ (this.partner == null || this.partner.isEmpty())) {
+ this.consumer =
+ new BusConsumer.DmaapAafConsumerWrapper(this.servers, this.topic,
+ this.apiKey, this.apiSecret,
+ this.userName, this.password,
+ this.consumerGroup, this.consumerInstance,
+ this.fetchTimeout, this.fetchLimit, this.useHttps);
+ } else {
+ this.consumer =
+ new BusConsumer.DmaapDmeConsumerWrapper(this.servers, this.topic,
+ this.apiKey, this.apiSecret,
+ this.userName, this.password,
+ this.consumerGroup, this.consumerInstance,
+ this.fetchTimeout, this.fetchLimit,
+ this.environment, this.aftEnvironment, this.partner,
+ this.latitude, this.longitude, this.additionalProps, this.useHttps);
+ }
PolicyLogger.info(className, "CREATION: " + this);
}
diff --git a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedUebTopicSource.java b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedUebTopicSource.java
index edb55c75..641eddaa 100644
--- a/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedUebTopicSource.java
+++ b/policy-endpoints/src/main/java/org/openecomp/policy/drools/event/comm/bus/internal/SingleThreadedUebTopicSource.java
@@ -42,18 +42,24 @@ public class SingleThreadedUebTopicSource extends SingleThreadedBusTopicSource
* @param consumerInstance UEB Reader Instance
* @param fetchTimeout UEB fetch timeout
* @param fetchLimit UEB fetch limit
+ * @param useHttps does topicSource use HTTPS?
+ * @param allowSelfSignedCerts does topicSource allow self-signed certs?
+ *
* @throws IllegalArgumentException An invalid parameter passed in
*/
+
+
public SingleThreadedUebTopicSource(List<String> servers, String topic,
String apiKey, String apiSecret,
String consumerGroup, String consumerInstance,
- int fetchTimeout, int fetchLimit)
+ int fetchTimeout, int fetchLimit, boolean useHttps, boolean allowSelfSignedCerts)
throws IllegalArgumentException {
super(servers, topic, apiKey, apiSecret,
consumerGroup, consumerInstance,
- fetchTimeout, fetchLimit);
+ fetchTimeout, fetchLimit, useHttps, allowSelfSignedCerts);
+ this.allowSelfSignedCerts = allowSelfSignedCerts;
this.init();
}
@@ -67,7 +73,7 @@ public class SingleThreadedUebTopicSource extends SingleThreadedBusTopicSource
new BusConsumer.CambriaConsumerWrapper(this.servers, this.topic,
this.apiKey, this.apiSecret,
this.consumerGroup, this.consumerInstance,
- this.fetchTimeout, this.fetchLimit);
+ this.fetchTimeout, this.fetchLimit, this.useHttps, this.allowSelfSignedCerts);
}
/**
@@ -77,6 +83,7 @@ public class SingleThreadedUebTopicSource extends SingleThreadedBusTopicSource
public CommInfrastructure getTopicCommInfrastructure() {
return Topic.CommInfrastructure.UEB;
}
+
@Override
public String toString() {
diff --git a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java
index ced3dcf4..47774b1f 100644
--- a/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java
+++ b/policy-endpoints/src/test/java/org/openecomp/policy/drools/http/server/test/HttpClientTest.java
@@ -114,7 +114,7 @@ public class HttpClientTest {
HttpClient.factory.destroy();
}
- @Test
+ //@Test
public void testHttpAuthClientProps() throws Exception {
System.out.println("-- testHttpAuthClientProps() --");
diff --git a/policy-healthcheck/pom.xml b/policy-healthcheck/pom.xml
index 3b45c916..5a409d4a 100644
--- a/policy-healthcheck/pom.xml
+++ b/policy-healthcheck/pom.xml
@@ -83,52 +83,7 @@
<addParentPoms>false</addParentPoms>
<copyPom>false</copyPom>
<excludeGroupIds>org.opendaylight,com.brocade.odl</excludeGroupIds>
- <scope>provided</scope>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-version</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/versions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/versions</directory>
- <includes>
- <include>version.properties</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>copy-resources</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/etc/bvc-extensions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/etc/bvc-extensions</directory>
- <includes>
- <include>feature_config_template.cfg</include>
- <include>feature_custom.install</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
+ <excludeScope>provided</excludeScope>
</configuration>
</execution>
</executions>
@@ -141,16 +96,19 @@
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-core</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-endpoints</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-management</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
diff --git a/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java b/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java
index ce1dd90b..321d1e73 100644
--- a/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java
+++ b/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java
@@ -2,90 +2,158 @@ package org.openecomp.policy.drools.healthcheck;
import java.util.Properties;
-import org.kie.api.runtime.KieSession;
-import org.openecomp.policy.drools.core.FeatureAPI;
-import org.openecomp.policy.drools.core.PolicyContainer;
-import org.openecomp.policy.drools.core.PolicySession;
+import org.openecomp.policy.drools.features.PolicyEngineFeatureAPI;
+import org.openecomp.policy.drools.system.PolicyEngine;
-public class HealthCheckFeature implements FeatureAPI {
+public class HealthCheckFeature implements PolicyEngineFeatureAPI {
public static final String CONFIGURATION_PROPERTIES_NAME = "policy-healthcheck";
+ /**
+ * {@inheritDoc}
+ */
@Override
public int getSequenceNumber() {
- return 2;
+ return 1000;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void globalInit(String[] args, String configDir) {
- return;
+ public boolean beforeStart(PolicyEngine engine) throws IllegalStateException {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public KieSession activatePolicySession(PolicyContainer policyContainer, String name, String kieBaseName) {
- return null;
+ public boolean afterStart(PolicyEngine engine) {
+ try {
+ HealthCheck.monitor.start();
+ } catch (IllegalStateException e) {
+ e.printStackTrace();
+ }
+
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void disposeKieSession(PolicySession policySession) {
- return;
+ public boolean beforeShutdown(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void destroyKieSession(PolicySession policySession) {
- return;
+ public boolean afterShutdown(PolicyEngine engine) {
+ try {
+ HealthCheck.monitor.stop();
+ } catch (IllegalStateException e) {
+ e.printStackTrace();
+ }
+
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeStartEngine() throws IllegalStateException {
- return;
+ public boolean beforeConfigure(PolicyEngine engine, Properties properties) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterStartEngine() {
- try {
- HealthCheck.monitor.start();
- } catch (IllegalStateException e) {
- e.printStackTrace();
- }
+ public boolean afterConfigure(PolicyEngine engine) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeActivate(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeShutdownEngine() {
- return;
+ public boolean afterActivate(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterShutdownEngine() {
- try {
- HealthCheck.monitor.stop();
- } catch (IllegalStateException e) {
- e.printStackTrace();
- }
+ public boolean beforeDeactivate(PolicyEngine engine) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterDeactivate(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeCreateController(String name, Properties properties) {
- return;
+ public boolean beforeStop(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterCreateController(String name) {
- return;
+ public boolean afterStop(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeStartController(String name) {
- return;
+ public boolean beforeLock(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterStartController(String name) {
- return;
+ public boolean afterLock(PolicyEngine engine) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeUnlock(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public boolean isPersistenceEnabled() {
+ public boolean afterUnlock(PolicyEngine engine) {
return false;
}
diff --git a/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI b/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI
index 7e307d08..7e307d08 100644
--- a/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI
+++ b/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI
diff --git a/policy-management/pom.xml b/policy-management/pom.xml
index 50d969d0..8b791e47 100644
--- a/policy-management/pom.xml
+++ b/policy-management/pom.xml
@@ -37,9 +37,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
- <jetty.version>9.3.8.v20160314</jetty.version>
- <jersey.version>2.22.2</jersey.version>
- <jackson.version>2.8.4</jackson.version>
+ <jetty.version>9.3.14.v20161028</jetty.version>
<gson.version>2.8.0</gson.version>
</properties>
@@ -87,8 +85,8 @@
<useRepositoryLayout>false</useRepositoryLayout>
<addParentPoms>false</addParentPoms>
<copyPom>false</copyPom>
- <excludeGroupIds>org.opendaylight,com.brocade.odl</excludeGroupIds>
- <scope>provided</scope>
+ <excludeGroupIds>javax.inject</excludeGroupIds>
+ <excludeScope>provided</excludeScope>
</configuration>
</execution>
</executions>
diff --git a/policy-management/src/main/java/org/openecomp/policy/drools/controller/internal/MavenDroolsController.java b/policy-management/src/main/java/org/openecomp/policy/drools/controller/internal/MavenDroolsController.java
index 2c5708d3..76bc5151 100644
--- a/policy-management/src/main/java/org/openecomp/policy/drools/controller/internal/MavenDroolsController.java
+++ b/policy-management/src/main/java/org/openecomp/policy/drools/controller/internal/MavenDroolsController.java
@@ -519,11 +519,13 @@ public class MavenDroolsController implements DroolsController {
this.getArtifactId(),
topic,
event);
+ } catch (UnsupportedOperationException uoe) {
+ if (logger.isInfoEnabled())
+ logger.info("DECODE:"+ this + ":" + topic + ":" + event);
+ return true;
} catch (Exception e) {
- logger.error(MessageCodes.EXCEPTION_ERROR, e,
- "DECODE:"+ this.getGroupId() + ":" +
- this.getArtifactId() + ":" + topic + ":" + event,
- this.toString());
+ e.printStackTrace();
+ logger.error("DECODE:"+ this + ":" + topic + ":" + event);
return true;
}
@@ -709,8 +711,7 @@ public class MavenDroolsController implements DroolsController {
builder.append("MavenDroolsController [policyContainer=")
.append((policyContainer != null) ? policyContainer.getName() : "NULL").append(":")
.append(", alive=")
- .append(alive).append(", locked=").append(locked).append(", decoderConfigurations=")
- .append(decoderConfigurations).append(", encoderConfigurations=").append(encoderConfigurations)
+ .append(alive).append(", locked=")
.append(", modelClassLoaderHash=").append(modelClassLoaderHash).append("]");
return builder.toString();
}
diff --git a/policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyControllerFeatureAPI.java b/policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyControllerFeatureAPI.java
new file mode 100644
index 00000000..3418d067
--- /dev/null
+++ b/policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyControllerFeatureAPI.java
@@ -0,0 +1,41 @@
+package org.openecomp.policy.drools.features;
+
+import java.util.Properties;
+
+import org.openecomp.policy.drools.system.PolicyController;
+import org.openecomp.policy.drools.utils.OrderedService;
+import org.openecomp.policy.drools.utils.OrderedServiceImpl;
+
+public interface PolicyControllerFeatureAPI extends OrderedService {
+
+ /**
+ * called before creating a controller with name 'name' and
+ * properties 'properties'
+ *
+ * @param name name of the the controller
+ * @param properties configuration properties
+ *
+ * @return a policy controller. A take over of the creation operation
+ * is performed by returning a non-null policy controller.
+ * 'null' indicates that no take over has taken place, and processing should
+ * continue to the next feature provider.
+ */
+ public PolicyController beforeCreate(String name, Properties properties);
+
+ /**
+ * called after creating a controller with name 'name'
+ *
+ * @param controller controller
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean afterCreate(PolicyController controller);
+
+ /**
+ * Feature providers implementing this interface
+ */
+ public static final OrderedServiceImpl<PolicyControllerFeatureAPI> providers =
+ new OrderedServiceImpl<PolicyControllerFeatureAPI>(PolicyControllerFeatureAPI.class);
+}
diff --git a/policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyEngineFeatureAPI.java b/policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyEngineFeatureAPI.java
new file mode 100644
index 00000000..c8298dde
--- /dev/null
+++ b/policy-management/src/main/java/org/openecomp/policy/drools/features/PolicyEngineFeatureAPI.java
@@ -0,0 +1,164 @@
+package org.openecomp.policy.drools.features;
+
+import java.util.Properties;
+
+import org.openecomp.policy.drools.system.PolicyEngine;
+import org.openecomp.policy.drools.utils.OrderedService;
+import org.openecomp.policy.drools.utils.OrderedServiceImpl;
+
+/**
+ * Policy Engine Feature API.
+ * Provides Interception Points during the Policy Engine lifecycle.
+ */
+public interface PolicyEngineFeatureAPI extends OrderedService {
+
+ /**
+ * intercept before the Policy Engine is configured.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean beforeConfigure(PolicyEngine engine, Properties properties);
+
+ /**
+ * intercept after the Policy Engine is configured.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean afterConfigure(PolicyEngine engine);
+
+ /**
+ * intercept before the Policy Engine goes active.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean beforeActivate(PolicyEngine engine);
+
+ /**
+ * intercept after the Policy Engine goes active.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean afterActivate(PolicyEngine engine);
+
+ /**
+ * intercept before the Policy Engine goes standby.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean beforeDeactivate(PolicyEngine engine);
+
+ /**
+ * intercept after the Policy Engine goes standby.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean afterDeactivate(PolicyEngine engine);
+
+ /**
+ * intercept before the Policy Engine is started.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean beforeStart(PolicyEngine engine);
+
+ /**
+ * intercept after the Policy Engine is started.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean afterStart(PolicyEngine engine);
+
+ /**
+ * intercept before the Policy Engine is stopped.
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise..
+ */
+ public boolean beforeStop(PolicyEngine engine);
+
+ /**
+ * intercept after the Policy Engine is stopped
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.d.
+ */
+ public boolean afterStop(PolicyEngine engine);
+
+ /**
+ * intercept before the Policy Engine is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean beforeLock(PolicyEngine engine);
+
+ /**
+ * intercept after the Policy Engine is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise..
+ */
+ public boolean afterLock(PolicyEngine engine);
+
+ /**
+ * intercept before the Policy Engine is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean beforeUnlock(PolicyEngine engine);
+
+ /**
+ * intercept after the Policy Engine is locked
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean afterUnlock(PolicyEngine engine);
+
+ /**
+ * intercept the Policy Engine is shut down
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise..
+ */
+ public boolean beforeShutdown(PolicyEngine engine);
+
+ /**
+ * called after the Policy Engine is shut down
+ *
+ * @return true if this feature intercepts and takes ownership
+ * of the operation preventing the invocation of
+ * lower priority features. False, otherwise.
+ */
+ public boolean afterShutdown(PolicyEngine engine);
+
+ /**
+ * Feature providers implementing this interface
+ */
+ public static final OrderedServiceImpl<PolicyEngineFeatureAPI> providers =
+ new OrderedServiceImpl<PolicyEngineFeatureAPI>(PolicyEngineFeatureAPI.class);
+}
diff --git a/policy-management/src/main/java/org/openecomp/policy/drools/system/PolicyEngine.java b/policy-management/src/main/java/org/openecomp/policy/drools/system/PolicyEngine.java
index 33f2a098..6933003e 100644
--- a/policy-management/src/main/java/org/openecomp/policy/drools/system/PolicyEngine.java
+++ b/policy-management/src/main/java/org/openecomp/policy/drools/system/PolicyEngine.java
@@ -28,7 +28,6 @@ import org.openecomp.policy.common.logging.eelf.MessageCodes;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
import org.openecomp.policy.drools.controller.DroolsController;
-import org.openecomp.policy.drools.core.FeatureAPI;
import org.openecomp.policy.drools.core.jmx.PdpJmxListener;
import org.openecomp.policy.drools.event.comm.Topic;
import org.openecomp.policy.drools.event.comm.Topic.CommInfrastructure;
@@ -36,6 +35,8 @@ import org.openecomp.policy.drools.event.comm.TopicEndpoint;
import org.openecomp.policy.drools.event.comm.TopicListener;
import org.openecomp.policy.drools.event.comm.TopicSink;
import org.openecomp.policy.drools.event.comm.TopicSource;
+import org.openecomp.policy.drools.features.PolicyControllerFeatureAPI;
+import org.openecomp.policy.drools.features.PolicyEngineFeatureAPI;
import org.openecomp.policy.drools.http.server.HttpServletServer;
import org.openecomp.policy.drools.persistence.SystemPersistence;
import org.openecomp.policy.drools.properties.Lockable;
@@ -329,19 +330,33 @@ class PolicyEngineManager implements PolicyEngine {
*/
protected List<HttpServletServer> httpServers = new ArrayList<HttpServletServer>();
+ /**
+ * gson parser to decode configuration requests
+ */
protected Gson decoder = new GsonBuilder().disableHtmlEscaping().create();
-
+
/**
* {@inheritDoc}
*/
@Override
- public void configure(Properties properties) throws IllegalArgumentException {
+ public synchronized void configure(Properties properties) throws IllegalArgumentException {
if (properties == null) {
logger.warn("No properties provided");
throw new IllegalArgumentException("No properties provided");
}
+ /* policy-engine dispatch pre configure hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeConfigure(this, properties))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
this.properties = properties;
try {
@@ -365,6 +380,17 @@ class PolicyEngineManager implements PolicyEngine {
logger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyEngine", "configure");
}
+ /* policy-engine dispatch post configure hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterConfigure(this))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
return;
}
@@ -372,7 +398,7 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public PolicyController createPolicyController(String name, Properties properties)
+ public synchronized PolicyController createPolicyController(String name, Properties properties)
throws IllegalArgumentException, IllegalStateException {
// check if a PROPERTY_CONTROLLER_NAME property is present
@@ -388,19 +414,31 @@ class PolicyEngineManager implements PolicyEngine {
name = propertyControllerName;
}
- // feature hook
- for (FeatureAPI feature : FeatureAPI.impl.getList()) {
- feature.beforeCreateController(name, properties);
+ PolicyController controller;
+ for (PolicyControllerFeatureAPI controllerFeature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ controller = controllerFeature.beforeCreate(name, properties);
+ if (controller != null)
+ return controller;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + controllerFeature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
- PolicyController controller = PolicyController.factory.build(name, properties);
+ controller = PolicyController.factory.build(name, properties);
if (this.isLocked())
controller.lock();
// feature hook
- for (FeatureAPI feature : FeatureAPI.impl.getList()) {
- // NOTE: this should change to the actual controller object
- feature.afterCreateController(name);
+ for (PolicyControllerFeatureAPI controllerFeature : PolicyControllerFeatureAPI.providers.getList()) {
+ try {
+ if (controllerFeature.afterCreate(controller))
+ return controller;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + controllerFeature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
return controller;
@@ -573,22 +611,24 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public boolean start() throws IllegalStateException {
-
- if (this.locked) {
- throw new IllegalStateException("Engine is locked");
- }
-
- // Features hook
- for (FeatureAPI feature : FeatureAPI.impl.getList()) {
- feature.beforeStartEngine();
- }
+ public synchronized boolean start() throws IllegalStateException {
- synchronized(this) {
- this.alive = true;
+ /* policy-engine dispatch pre start hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeStart(this))
+ return true;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
-
+
boolean success = true;
+ if (this.locked)
+ throw new IllegalStateException("Engine is locked");
+
+ this.alive = true;
/* Start Policy Engine exclusively-owned (unmanaged) http servers */
@@ -600,6 +640,7 @@ class PolicyEngineManager implements PolicyEngine {
logger.error(MessageCodes.EXCEPTION_ERROR, e, httpServer.toString(), this.toString());
}
}
+
/* Start Policy Engine exclusively-owned (unmanaged) sources */
for (TopicSource source: this.sources) {
@@ -650,9 +691,15 @@ class PolicyEngineManager implements PolicyEngine {
PdpJmxListener.start();
- // Features hook
- for (FeatureAPI feature : FeatureAPI.impl.getList()) {
- feature.afterStartEngine();
+ /* policy-engine dispatch after start hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterStart(this))
+ return success;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
return success;
@@ -662,18 +709,27 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public boolean stop() {
-
- /* stop regardless of the lock state */
+ public synchronized boolean stop() {
- synchronized(this) {
- if (!this.alive)
- return true;
-
- this.alive = false;
+ /* policy-engine dispatch pre stop hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeStop(this))
+ return true;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
+ /* stop regardless of the lock state */
+
boolean success = true;
+ if (!this.alive)
+ return true;
+
+ this.alive = false;
+
List<PolicyController> controllers = PolicyController.factory.inventory();
for (PolicyController controller : controllers) {
try {
@@ -719,6 +775,17 @@ class PolicyEngineManager implements PolicyEngine {
}
}
+ /* policy-engine dispatch pre stop hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterStop(this))
+ return success;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
return success;
}
@@ -726,17 +793,21 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public void shutdown() throws IllegalStateException {
-
- synchronized(this) {
- this.alive = false;
- }
+ public synchronized void shutdown() throws IllegalStateException {
- // feature hook reporting that the Policy Engine is being shut down
- for (FeatureAPI feature : FeatureAPI.impl.getList()) {
- feature.beforeShutdownEngine();
+ /* policy-engine dispatch pre shutdown hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeShutdown(this))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
-
+
+ this.alive = false;
+
/* Shutdown Policy Engine owned (unmanaged) sources */
for (TopicSource source: this.sources) {
try {
@@ -764,10 +835,17 @@ class PolicyEngineManager implements PolicyEngine {
PdpJmxListener.stop();
- // feature hook reporting that the Policy Engine has being shut down
- for (FeatureAPI feature : FeatureAPI.impl.getList()) {
- feature.afterShutdownEngine();
+ /* policy-engine dispatch post shutdown hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterShutdown(this))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
+
new Thread(new Runnable() {
@Override
@@ -802,7 +880,7 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public boolean isAlive() {
+ public synchronized boolean isAlive() {
return this.alive;
}
@@ -810,15 +888,24 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public boolean lock() {
+ public synchronized boolean lock() {
- synchronized(this) {
- if (this.locked)
- return true;
-
- this.locked = true;
+ /* policy-engine dispatch pre lock hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeLock(this))
+ return true;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
+ if (this.locked)
+ return true;
+
+ this.locked = true;
+
boolean success = true;
List<PolicyController> controllers = PolicyController.factory.inventory();
for (PolicyController controller : controllers) {
@@ -830,7 +917,19 @@ class PolicyEngineManager implements PolicyEngine {
}
}
- success = TopicEndpoint.manager.lock();
+ success = TopicEndpoint.manager.lock() && success;
+
+ /* policy-engine dispatch post lock hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterLock(this))
+ return success;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
return success;
}
@@ -838,14 +937,24 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public boolean unlock() {
- synchronized(this) {
- if (!this.locked)
- return true;
-
- this.locked = false;
+ public synchronized boolean unlock() {
+
+ /* policy-engine dispatch pre unlock hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeUnlock(this))
+ return true;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
}
+ if (!this.locked)
+ return true;
+
+ this.locked = false;
+
boolean success = true;
List<PolicyController> controllers = PolicyController.factory.inventory();
for (PolicyController controller : controllers) {
@@ -857,7 +966,19 @@ class PolicyEngineManager implements PolicyEngine {
}
}
- success = TopicEndpoint.manager.unlock();
+ success = TopicEndpoint.manager.unlock() && success;
+
+ /* policy-engine dispatch after unlock hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterUnlock(this))
+ return success;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
return success;
}
@@ -865,7 +986,7 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public boolean isLocked() {
+ public synchronized boolean isLocked() {
return this.locked;
}
@@ -945,7 +1066,7 @@ class PolicyEngineManager implements PolicyEngine {
* {@inheritDoc}
*/
@Override
- public boolean onTopicEvent(CommInfrastructure commType, String topic, String event) {
+ public void onTopicEvent(CommInfrastructure commType, String topic, String event) {
/* configuration request */
try {
PdpdConfiguration configuration = this.decoder.fromJson(event, PdpdConfiguration.class);
@@ -953,8 +1074,6 @@ class PolicyEngineManager implements PolicyEngine {
} catch (Exception e) {
logger.error(MessageCodes.EXCEPTION_ERROR, e, "CONFIGURATION ERROR IN PDP-D POLICY ENGINE: "+ event + ":" + e.getMessage() + ":" + this);
}
-
- return true;
}
/**
@@ -1131,6 +1250,17 @@ class PolicyEngineManager implements PolicyEngine {
*/
@Override
public synchronized void activate() {
+
+ /* policy-engine dispatch pre activate hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeActivate(this))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
// activate 'policy-management'
for (PolicyController policyController : getPolicyControllers()) {
@@ -1147,6 +1277,17 @@ class PolicyEngineManager implements PolicyEngine {
}
this.unlock();
+
+ /* policy-engine dispatch post activate hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterActivate(this))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
}
/**
@@ -1155,6 +1296,17 @@ class PolicyEngineManager implements PolicyEngine {
@Override
public synchronized void deactivate() {
+ /* policy-engine dispatch pre deactivate hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.beforeDeactivate(this))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
this.lock();
for (PolicyController policyController : getPolicyControllers()) {
@@ -1167,7 +1319,18 @@ class PolicyEngineManager implements PolicyEngine {
logger.error(MessageCodes.EXCEPTION_ERROR, e, "PolicyEngine.deactivate: cannot start " +
policyController + " because of " + e.getMessage());
}
- }
+ }
+
+ /* policy-engine dispatch post deactivate hook */
+ for (PolicyEngineFeatureAPI feature : PolicyEngineFeatureAPI.providers.getList()) {
+ try {
+ if (feature.afterDeactivate(this))
+ return;
+ } catch (Exception e) {
+ System.out.println("ERROR: Feature API: " + feature.getClass().getName() + e.getMessage());
+ e.printStackTrace();
+ }
+ }
}
@Override
diff --git a/policy-management/src/main/java/org/openecomp/policy/drools/system/internal/AggregatedPolicyController.java b/policy-management/src/main/java/org/openecomp/policy/drools/system/internal/AggregatedPolicyController.java
index 96f9e5bf..3badbd08 100644
--- a/policy-management/src/main/java/org/openecomp/policy/drools/system/internal/AggregatedPolicyController.java
+++ b/policy-management/src/main/java/org/openecomp/policy/drools/system/internal/AggregatedPolicyController.java
@@ -317,18 +317,18 @@ public class AggregatedPolicyController implements PolicyController,
* {@inheritDoc}
*/
@Override
- public boolean onTopicEvent(Topic.CommInfrastructure commType,
+ public void onTopicEvent(Topic.CommInfrastructure commType,
String topic, String event) {
logger.info("EVENT NOTIFICATION: " + commType + ":" + topic + ":" + event + " INTO " + this);
if (this.locked)
- return false;
+ return;
if (!this.alive)
- return true;
+ return;
- return this.droolsController.offer(topic, event);
+ this.droolsController.offer(topic, event);
}
/**
@@ -444,8 +444,7 @@ public class AggregatedPolicyController implements PolicyController,
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
- builder.append("AggregatedPolicyController [name=").append(name).append(", sources=").append(sources)
- .append(", sinks=").append(sinks).append(", alive=").append(alive).append(", locked=").append(locked)
+ builder.append("AggregatedPolicyController [name=").append(name).append(", alive=").append(alive).append(", locked=").append(locked)
.append(", droolsController=").append(droolsController).append("]");
return builder.toString();
}
diff --git a/policy-management/src/main/server/config/IntegrityMonitor.properties b/policy-management/src/main/server/config/IntegrityMonitor.properties
index 1201a9da..ee7d5eb0 100644
--- a/policy-management/src/main/server/config/IntegrityMonitor.properties
+++ b/policy-management/src/main/server/config/IntegrityMonitor.properties
@@ -20,6 +20,12 @@
hostPort = ${{host_port}}
+http.server.services=TEST
+http.server.services.TEST.host=0.0.0.0
+http.server.services.TEST.port=9981
+http.server.services.TEST.restClasses=org.openecomp.policy.drools.core.IntegrityMonitorRestManager
+http.server.services.TEST.managed=false
+
# The following were added as part of US673632
#
# Forward Progress Monitor update interval seconds
@@ -64,8 +70,10 @@ resource.name=${{resource_name}}
integrity_audit_period_seconds=-1
# Properties needed for repository audit
-repository.audit.id=${{repositoryID}}
-repository.audit.url=${{repositoryUrl}}
+# Assume it's the releaseRepository that needs to be audited,
+# because that's the one BRMGW will publish to.
+repository.audit.id=${{releaseRepositoryID}}
+repository.audit.url=${{releaseRepositoryUrl}}
repository.audit.username=${{repositoryUsername}}
repository.audit.password=${{repositoryPassword}}
@@ -74,8 +82,4 @@ db.audit.is.active=false
# Flag to control the execution of the subsystemTest for the Nexus Maven repository
repository.audit.is.active=false
-
-
-
-
-
+repository.audit.ignore.errors=true
diff --git a/policy-management/src/main/server/config/logback.xml b/policy-management/src/main/server/config/logback.xml
index 545b6f48..6b016206 100644
--- a/policy-management/src/main/server/config/logback.xml
+++ b/policy-management/src/main/server/config/logback.xml
@@ -38,7 +38,7 @@
<!-- modified time stamp format -->
<property name="defaultPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}||%X{ProcessKey}|%X{TargetVirtualEntity}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" />
<property name="defaultMetricPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}||%X{ProcessKey}|%X{TargetVirtualEntity}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" />
- <property name="defaultAuditPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}||%X{ProcessKey}|%X{TargetVirtualEntity}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" />
+ <property name="defaultAuditPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}||%X{ProcessKey}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}|%msg%n" />
<property name="defaultErrorPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{ErrorCategory}|%X{ErrorCode}|%X{ErrorDesciption}|%msg%n" />
<property name="defaultPatternOld" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}|%msg%n" />
diff --git a/policy-persistence/pom.xml b/policy-persistence/pom.xml
index 9b327635..b8677619 100644
--- a/policy-persistence/pom.xml
+++ b/policy-persistence/pom.xml
@@ -37,8 +37,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
- <cambria.version>0.2.4</cambria.version>
- <dmaap.version>0.2.9</dmaap.version>
+ <swagger.version>1.5.0</swagger.version>
</properties>
<build>
@@ -84,53 +83,8 @@
<useRepositoryLayout>false</useRepositoryLayout>
<addParentPoms>false</addParentPoms>
<copyPom>false</copyPom>
- <excludeGroupIds>org.opendaylight,com.brocade.odl</excludeGroupIds>
- <scope>provided</scope>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-version</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/versions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/versions</directory>
- <includes>
- <include>version.properties</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>copy-resources</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/etc/bvc-extensions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/etc/bvc-extensions</directory>
- <includes>
- <include>feature_config_template.cfg</include>
- <include>feature_custom.install</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
+ <excludeGroupIds>javax.inject</excludeGroupIds>
+ <excludeScope>provided</excludeScope>
</configuration>
</execution>
</executions>
@@ -140,14 +94,21 @@
<dependencies>
<dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-jersey2-jaxrs</artifactId>
+ <version>${swagger.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-core</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-management</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/DroolsPDPIntegrityMonitor.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/DroolsPDPIntegrityMonitor.java
index 2b6058fd..dc63d719 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/DroolsPDPIntegrityMonitor.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/DroolsPDPIntegrityMonitor.java
@@ -22,23 +22,18 @@ package org.openecomp.policy.drools.core;
import java.io.File;
import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.net.InetSocketAddress;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.Properties;
-import java.util.concurrent.Callable;
import org.openecomp.policy.common.im.IntegrityMonitor;
-import org.openecomp.policy.common.logging.flexlogger.PropertyUtil;
+import org.openecomp.policy.common.logging.eelf.MessageCodes;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
-import org.openecomp.policy.common.logging.eelf.MessageCodes;
-import org.openecomp.policy.drools.persistence.DroolsPdpsElectionHandler;
+import org.openecomp.policy.common.logging.flexlogger.PropertyUtil;
+import org.openecomp.policy.drools.http.server.HttpServletServer;
import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
-import com.sun.net.httpserver.HttpExchange;
-import com.sun.net.httpserver.HttpHandler;
-import com.sun.net.httpserver.HttpServer;
+import org.openecomp.policy.drools.properties.Startable;
/**
* This class extends 'IntegrityMonitor' for use in the 'Drools PDP'
@@ -233,11 +228,11 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor
// create http server
try {
logger.info("init: Starting HTTP server, addr=" + addr);
- HttpServer server = HttpServer.create(addr, 0);
- server.createContext("/test", new TestHandler());
- server.setExecutor(null);
- server.start();
- System.out.println("init: Started server on hostPort=" + hostPort);
+ IntegrityMonitorRestServer server = new IntegrityMonitorRestServer();
+
+ server.init(integrityMonitorProperties);
+
+ System.out.println("init: Started server on hostPort=" + hostPort);
} catch (Exception e) {
if (PolicyContainer.isUnitTesting) {
System.out
@@ -378,100 +373,59 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor
*/
abstract void invoke(Properties droolsPersistenceProperties) throws Exception;
}
-
- /* ============================================================ */
-
- /**
- * This class is the HTTP handler for the REST 'test' invocation
- */
- static class TestHandler implements HttpHandler
- {
- /**
- * Handle an incoming REST 'test' invocation
- * @param ex used to pass incoming and outgoing HTTP information
- */
- @Override
- public void handle(HttpExchange ex) throws IOException
- {
-
- System.out.println("TestHandler.handle: Entering");
-
- // The responses are stored within the audit objects, so we need to
- // invoke the audits and get responses before we handle another
- // request.
- synchronized(TestHandler.class)
- {
- // will include messages associated with subsystem failures
- StringBuilder body = new StringBuilder();
-
- // 200=SUCCESS, 500=failure
- int responseValue = 200;
-
- if (im != null)
- {
- try
- {
- // call 'IntegrityMonitor.evaluateSanity()'
- im.evaluateSanity();
- }
- catch (Exception e)
- {
- // this exception isn't coming from one of the audits,
- // because those are caught in 'subsystemTest()'
- logger.error
- (MessageCodes.EXCEPTION_ERROR, e,
- "DroolsPDPIntegrityMonitor.evaluateSanity()");
-
- // include exception in HTTP response
- body.append("\nException: " + e + "\n");
- responseValue = 500;
+
+ public static class IntegrityMonitorRestServer implements Startable {
+ protected volatile HttpServletServer server = null;
+ protected volatile Properties integrityMonitorRestServerProperties = null;
+
+ public void init(Properties props) {
+ this.integrityMonitorRestServerProperties = props;
+ this.start();
+ }
+
+ @Override
+ public boolean start() throws IllegalStateException {
+ try {
+ ArrayList<HttpServletServer> servers = HttpServletServer.factory.build(integrityMonitorRestServerProperties);
+
+ if (!servers.isEmpty()) {
+ server = servers.get(0);
+
+ try {
+ server.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
+ } catch (Exception e) {
+ return false;
}
-/*
- * Audit failures are being logged. A string will be generated which captures the
- * the audit failures. This string will be included in an exception coming from im.evaluateSanity().
- *
- // will contain list of subsystems where the audit failed
- LinkedList<String> subsystems = new LinkedList<String>();
+
+ return true;
+ }
- // Loop through all of the audits, and see which ones have failed.
- // NOTE: response information is stored within the audit objects
- // themselves -- only one can run at a time.
- for (AuditBase audit : audits)
- {
- String response = audit.getResponse();
- if (response != null)
- {
- // the audit has failed -- update 'subsystems', 'body',
- // and 'responseValue' with the new information
- subsystems.add(audit.getName());
- body
- .append('\n')
- .append(audit.getName())
- .append(":\n")
- .append(response)
- .append('\n');
- responseValue = 500;
- }
+ @Override
+ public boolean stop() throws IllegalStateException {
+ try {
+ server.stop();
+ } catch (Exception e) {
+ e.printStackTrace();
}
+
+ return true;
+ }
- if (subsystems.size() != 0)
- {
- // there is at least one failure -- add HTTP headers
- ex.getResponseHeaders().put("X-ECOMP-SubsystemFailure",
- subsystems);
- }
-*/
- // send response, including the contents of 'body'
- // (which is empty if everything is successful)
- ex.sendResponseHeaders(responseValue, body.length());
- OutputStream os = ex.getResponseBody();
- os.write(body.toString().getBytes());
- os.close();
- System.out.println("TestHandler.handle: Exiting");
+ @Override
+ public void shutdown() throws IllegalStateException {
+ this.stop();
}
- }
- }
+
+ @Override
+ public synchronized boolean isAlive() {
+ return this.integrityMonitorRestServerProperties != null;
+ }
+ }
+
public static DroolsPDPIntegrityMonitor getInstance() throws Exception{
logger.info("getInstance() called");
if (im == null) {
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorRestManager.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorRestManager.java
new file mode 100644
index 00000000..e0cb0638
--- /dev/null
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/IntegrityMonitorRestManager.java
@@ -0,0 +1,91 @@
+package org.openecomp.policy.drools.core;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Response;
+
+import org.openecomp.policy.common.logging.eelf.MessageCodes;
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+
+@Api(value = "test")
+ @Path("/")
+public class IntegrityMonitorRestManager {
+ private static Logger logger = FlexLogger.getLogger(IntegrityMonitorRestManager.class);
+ private DroolsPDPIntegrityMonitor im;
+
+ /**
+ * Test interface for Integrity Monitor
+ *
+ * @return Exception message if exception, otherwise empty
+ */
+ @ApiOperation(
+ value = "Test endpoint for integrity monitor",
+ notes = "The TEST command is used to request data from a subcomponent "
+ + "instance that can be used to determine its operational state. "
+ + "A 200/success response status code should be returned if the "
+ + "subcomponent instance is functioning properly and able to respond to requests.",
+ response = String.class)
+ @ApiResponses(value = {
+ @ApiResponse(
+ code = 200,
+ message = "Integrity monitor sanity check passed"),
+ @ApiResponse(
+ code = 500,
+ message = "Integrity monitor sanity check encountered an exception. This can indicate operational state disabled or administrative state locked")
+ })
+ @GET
+ @Path("test")
+ public Response test() {
+ logger.error("integrity monitor /test accessed");
+ // The responses are stored within the audit objects, so we need to
+ // invoke the audits and get responses before we handle another
+ // request.
+ synchronized (IntegrityMonitorRestManager.class) {
+ // will include messages associated with subsystem failures
+ StringBuilder body = new StringBuilder();
+
+ // 200=SUCCESS, 500=failure
+ int responseValue = 200;
+
+ if (im == null) {
+ try {
+ im = DroolsPDPIntegrityMonitor.getInstance();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+
+ body.append("\nException: " + e + "\n");
+ responseValue = 500;
+ }
+ }
+
+ if (im != null) {
+ try {
+ // call 'IntegrityMonitor.evaluateSanity()'
+ im.evaluateSanity();
+ } catch (Exception e) {
+ // this exception isn't coming from one of the audits,
+ // because those are caught in 'subsystemTest()'
+ logger.error(MessageCodes.EXCEPTION_ERROR, e, "DroolsPDPIntegrityMonitor.evaluateSanity()");
+
+ // include exception in HTTP response
+ body.append("\nException: " + e + "\n");
+ responseValue = 500;
+ }
+ }
+
+ // send response, including the contents of 'body'
+ // (which is empty if everything is successful)
+ if (responseValue == 200)
+ return Response.status(Response.Status.OK).build();
+ else
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(body.toString()).build();
+ }
+ }
+} \ No newline at end of file
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java
index 86c672e2..c4301364 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/core/RepositoryAudit.java
@@ -79,8 +79,12 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
logger.info("Running 'RepositoryAudit.invoke'");
boolean isActive = true;
+ boolean ignoreErrors = true; // ignore errors by default
String repoAuditIsActive = IntegrityMonitorProperties.getProperty("repository.audit.is.active");
- logger.debug("RepositoryAudit.invoke: repoAuditIsActive = " + repoAuditIsActive);
+ String repoAuditIgnoreErrors =
+ IntegrityMonitorProperties.getProperty("repository.audit.ignore.errors");
+ logger.debug("RepositoryAudit.invoke: repoAuditIsActive = " + repoAuditIsActive
+ + ", repoAuditIgnoreErrors = " + repoAuditIgnoreErrors);
if (repoAuditIsActive != null) {
try {
@@ -95,6 +99,18 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
return;
}
+ if (repoAuditIgnoreErrors != null)
+ {
+ try
+ {
+ ignoreErrors = Boolean.parseBoolean(repoAuditIgnoreErrors.trim());
+ }
+ catch (NumberFormatException e)
+ {
+ logger.warn("RepositoryAudit.invoke: Ignoring invalid property: repository.audit.ignore.errors = " + repoAuditIgnoreErrors);
+ }
+ }
+
// Fetch repository information from 'IntegrityMonitorProperties'
String repositoryId =
IntegrityMonitorProperties.getProperty("repository.audit.id");
@@ -126,9 +142,12 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
logger.error
("RepositoryAudit: Invalid 'repository.audit.timeout' value: '"
+ timeoutString + "'");
- response.append("Invalid 'repository.audit.timeout' value: '")
- .append(timeoutString).append("'\n");
- setResponse(response.toString());
+ if (!ignoreErrors)
+ {
+ response.append("Invalid 'repository.audit.timeout' value: '")
+ .append(timeoutString).append("'\n");
+ setResponse(response.toString());
+ }
}
}
@@ -191,8 +210,11 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
{
logger.error
("RepositoryAudit: 'mvn deploy:deploy-file' failed");
- response.append("'mvn deploy:deploy-file' failed\n");
- setResponse(response.toString());
+ if (!ignoreErrors)
+ {
+ response.append("'mvn deploy:deploy-file' failed\n");
+ setResponse(response.toString());
+ }
}
else
{
@@ -295,8 +317,11 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
{
logger.error
("RepositoryAudit: 'mvn compile' invocation failed");
- response.append("'mvn compile' invocation failed\n");
- setResponse(response.toString());
+ if (!ignoreErrors)
+ {
+ response.append("'mvn compile' invocation failed\n");
+ setResponse(response.toString());
+ }
}
/*
@@ -362,9 +387,12 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
// Audit ERROR: artifact download failed for some reason
logger.error("RepositoryAudit: "
+ artifact.toString() + ": does not exist");
- response.append("Failed to download artifact: ")
- .append(artifact).append('\n');
- setResponse(response.toString());
+ if (!ignoreErrors)
+ {
+ response.append("Failed to download artifact: ")
+ .append(artifact).append('\n');
+ setResponse(response.toString());
+ }
}
}
@@ -385,8 +413,11 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase
{
logger.error
("RepositoryAudit: delete of uploaded artifact failed");
- response.append("delete of uploaded artifact failed\n");
- setResponse(response.toString());
+ if (!ignoreErrors)
+ {
+ response.append("delete of uploaded artifact failed\n");
+ setResponse(response.toString());
+ }
}
else
{
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java
index 82ee5d1d..40a8a56b 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/DroolsPdpsElectionHandler.java
@@ -499,159 +499,38 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
/*
* We have checked the four combinations of isDesignated and isCurrent. Where appropriate,
* we added the PDPs to the potential list of designated pdps
- * Check if listOfDesignated is empty, has one entry or has multiple entries
- * If it has multiple designated PDPs, then we must determine if myPdp is on the list and if
- * it is the lowest priority. If it is on the list and it is not the lowest
- * priority, it must be demoted. Then, we must find the lowest priority
- * PDP so we can get the right list of sessions
+ *
+ * We need to give priority to pdps on the same site that is currently being used
+ * First, however, we must sanitize the list of designated to make sure their are
+ * only designated members or non-designated members. There should not be both in
+ * the list. Because there are real time delays, it is possible that both types could
+ * be on the list.
*/
- //we need to give priority to pdps on the same site that is currently being used
-
-
- //we need to figure out the last pdp that was the primary so we can get the last site name and the last session numbers
- DroolsPdp mostRecentPrimary = new DroolsPdpImpl(null, true, 1, new Date(0));
- mostRecentPrimary.setSiteName(null);
- for(DroolsPdp pdp : pdps){
- if(pdp.getDesignatedDate().compareTo(mostRecentPrimary.getDesignatedDate()) > 0){
- mostRecentPrimary = pdp;
- }
- }
-
- if(listOfDesignated.size() > 1){
- logger.debug
- //System.out.println
- ("DesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated.size(): " + listOfDesignated.size());
- DroolsPdp rejectedPdp = null;
- DroolsPdp lowestPrioritySameSite = null;
- DroolsPdp lowestPriorityDifferentSite = null;
- for(DroolsPdp pdp : listOfDesignated){
- // We need to determine if another PDP is the lowest priority
- if(nullSafeEquals(pdp.getSiteName(),mostRecentPrimary.getSiteName())){
- if(lowestPrioritySameSite == null){
- if(lowestPriorityDifferentSite != null){
- rejectedPdp = lowestPriorityDifferentSite;
- }
- lowestPrioritySameSite = pdp;
- }else{
- if(pdp.getPdpId().equals((lowestPrioritySameSite.getPdpId()))){
- continue;//nothing to compare
- }
- if(pdp.comparePriority(lowestPrioritySameSite) <0){
- logger.debug
- //System.out.println
- ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
- + " has lower priority than pdp ID: " + lowestPrioritySameSite.getPdpId());
-
- //we need to reject lowestPrioritySameSite
- rejectedPdp = lowestPrioritySameSite;
- lowestPrioritySameSite = pdp;
- } else{
- //we need to reject pdp and keep lowestPrioritySameSite
- logger.debug
- //System.out.println
- ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
- + " has higher priority than pdp ID: " + lowestPrioritySameSite.getPdpId());
- rejectedPdp = pdp;
- }
- }
- } else{
- if(lowestPrioritySameSite != null){
- //if we already have a candidate for same site, we don't want to bother with different sites
- rejectedPdp = pdp;
- } else{
- if(lowestPriorityDifferentSite == null){
- lowestPriorityDifferentSite = pdp;
- continue;
- }
- if(pdp.getPdpId().equals((lowestPriorityDifferentSite.getPdpId()))){
- continue;//nothing to compare
- }
- if(pdp.comparePriority(lowestPriorityDifferentSite) <0){
- logger.debug
- //System.out.println
- ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
- + " has lower priority than pdp ID: " + lowestPriorityDifferentSite.getPdpId());
-
- //we need to reject lowestPriorityDifferentSite
- rejectedPdp = lowestPriorityDifferentSite;
- lowestPriorityDifferentSite = pdp;
- } else{
- //we need to reject pdp and keep lowestPriorityDifferentSite
- logger.debug
- //System.out.println
- ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
- + " has higher priority than pdp ID: " + lowestPriorityDifferentSite.getPdpId());
- rejectedPdp = pdp;
- }
- }
- }
- // If the rejectedPdp is myPdp, we need to stand it down and demote it. Each pdp is responsible
- // for demoting itself
- if(rejectedPdp != null && nullSafeEquals(rejectedPdp.getPdpId(),myPdp.getPdpId())){
- logger.debug
- //System.out.println
- ("\n\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated myPdp ID: " + myPdp.getPdpId()
- + " is NOT the lowest priority. Executing stateManagement.demote()" + "\n\n");
- // We found that myPdp is on the listOfDesignated and it is not the lowest priority
- // So, we must demote it
- try {
- //Keep the order like this. StateManagement is last since it triggers controller shutdown
- myPdp.setDesignated(false);
- pdpsConnector.setDesignated(myPdp, false);
- isDesignated = false;
- String standbyStatus = stateManagement.getStandbyStatus();
- if(!(standbyStatus.equals(StateManagement.HOT_STANDBY) ||
- standbyStatus.equals(StateManagement.COLD_STANDBY))){
- /*
- * Only call demote if it is not already in the right state. Don't worry about
- * synching the lower level topic endpoint states. That is done by the
- * refreshStateAudit.
- */
- stateManagement.demote();
- }
- } catch (Exception e) {
- myPdp.setDesignated(false);
- pdpsConnector.setDesignated(myPdp, false);
- isDesignated = false;
- logger.error
- //System.out.println
- ("DesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " Caught Exception attempting to demote myPdp'"
- + myPdp.getPdpId()
- + "', message="
- + e.getMessage());
- System.out.println(new Date() + " DesignatedWaiter.run: caught unexpected exception "
- + "from stateManagement.demote()");
- e.printStackTrace();
- }
- }
- } //end: for(DroolsPdp pdp : listOfDesignated)
- if(lowestPrioritySameSite != null){
- lowestPriorityPdp = lowestPrioritySameSite;
- } else {
- lowestPriorityPdp = lowestPriorityDifferentSite;
- }
- //now we have a valid value for lowestPriorityPdp
- logger.debug
- //System.out.println
- ("\n\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated found the LOWEST priority pdp ID: "
- + lowestPriorityPdp.getPdpId()
- + " It is now the designatedPpd from the perspective of myPdp ID: " + myPdp + "\n\n");
- designatedPdp = lowestPriorityPdp;
- this.sessions = mostRecentPrimary.getSessions();
+
+ listOfDesignated = santizeDesignatedList(listOfDesignated);
- } else if(listOfDesignated.isEmpty()){
- logger.debug
- //System.out.println
- ("\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated is: EMPTY.");
- designatedPdp = null;
- } else{ //only one in listOfDesignated
- logger.debug
- //System.out.println
- ("\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated has ONE entry. PDP ID: "
- + listOfDesignated.get(0).getPdpId());
- designatedPdp = listOfDesignated.get(0);
- this.sessions = mostRecentPrimary.getSessions();
- }
+ /*
+ * We need to figure out the last pdp that was the primary so we can get the last site
+ * name and the last session numbers. We need to create a "dummy" droolspdp since
+ * it will be used in later comparrisons and cannot be null.
+ */
+
+ DroolsPdp mostRecentPrimary = computeMostRecentPrimary(pdps, listOfDesignated);
+
+
+ /*
+ * It is possible to get here with more than one pdp designated and providingservice. This normally
+ * occurs when there is a race condition with multiple nodes coming up at the same time. If that is
+ * the case we must determine which one is the one that should be designated and which one should
+ * be demoted.
+ *
+ * It is possible to have 0, 1, 2 or more but not all, or all designated.
+ * If we have one designated and current, we chose it and are done
+ * If we have 2 or more, but not all, we must determine which one is in the same site as
+ * the previously designated pdp.
+ */
+
+ designatedPdp = computeDesignatedPdp(listOfDesignated, mostRecentPrimary);
if (designatedPdp == null) {
@@ -686,7 +565,10 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
* Only call promote if it is not already in the right state. Don't worry about
* synching the lower level topic endpoint states. That is done by the
* refreshStateAudit.
+ * Note that we need to fetch the session list from 'mostRecentPrimary'
+ * at this point -- soon, 'mostRecentPrimary' will be set to this host.
*/
+ this.sessions = mostRecentPrimary.getSessions();
stateManagement.promote();
}
} catch (StandbyStatusException e) {
@@ -784,6 +666,262 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
} // end run
}
+ public ArrayList<DroolsPdp> santizeDesignatedList(ArrayList<DroolsPdp> listOfDesignated){
+
+ boolean containsDesignated = false;
+ boolean containsHotStandby = false;
+ ArrayList<DroolsPdp> listForRemoval = new ArrayList<DroolsPdp>();
+ for(DroolsPdp pdp : listOfDesignated){
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run sanitizing: pdp = " + pdp.getPdpId()
+ + " isDesignated = " + pdp.isDesignated());
+ if(pdp.isDesignated()){
+ containsDesignated = true;
+ }else {
+ containsHotStandby = true;
+ listForRemoval.add(pdp);
+ }
+ }
+ if(containsDesignated && containsHotStandby){
+ //remove the hot standby from the list
+ listOfDesignated.removeAll(listForRemoval);
+ containsHotStandby = false;
+ }
+ return listOfDesignated;
+ }
+
+ public DroolsPdp computeMostRecentPrimary(Collection<DroolsPdp> pdps, ArrayList<DroolsPdp> listOfDesignated){
+ boolean containsDesignated = false;
+ for(DroolsPdp pdp : listOfDesignated){
+ if(pdp.isDesignated()){
+ containsDesignated = true;
+ }
+ }
+ DroolsPdp mostRecentPrimary = new DroolsPdpImpl(null, true, 1, new Date(0));
+ mostRecentPrimary.setSiteName(null);
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run listOfDesignated.size() = " + listOfDesignated.size());
+ if(listOfDesignated.size() <=1){
+ logger.debug("DesignatedWainter.run: listOfDesignated.size <=1");
+ //Only one or none is designated or hot standby. Choose the latest designated date
+ for(DroolsPdp pdp : pdps){
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run pdp = " + pdp.getPdpId()
+ + " pdp.getDesignatedDate() = " + pdp.getDesignatedDate());
+ if(pdp.getDesignatedDate().compareTo(mostRecentPrimary.getDesignatedDate()) > 0){
+ mostRecentPrimary = pdp;
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run mostRecentPrimary = " + mostRecentPrimary.getPdpId());
+ }
+ }
+ }else if(listOfDesignated.size() == pdps.size()){
+ logger.debug("DesignatedWainter.run: listOfDesignated.size = pdps.size() which is " + pdps.size());
+ //They are all designated or all hot standby.
+ mostRecentPrimary = null;
+ for(DroolsPdp pdp : pdps){
+ if(mostRecentPrimary == null){
+ mostRecentPrimary = pdp;
+ continue;
+ }
+ if(containsDesignated){ //Choose the site of the first designated date
+ if(pdp.getDesignatedDate().compareTo(mostRecentPrimary.getDesignatedDate()) < 0){
+ mostRecentPrimary = pdp;
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run mostRecentPrimary = " + mostRecentPrimary.getPdpId());
+ }
+ }else{ //Choose the site with the latest designated date
+ if(pdp.getDesignatedDate().compareTo(mostRecentPrimary.getDesignatedDate()) > 0){
+ mostRecentPrimary = pdp;
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run mostRecentPrimary = " + mostRecentPrimary.getPdpId());
+ }
+ }
+ }
+ }else{
+ logger.debug("DesignatedWainter.run: Some but not all are designated or hot standby. ");
+ //Some but not all are designated or hot standby.
+ if(containsDesignated){
+ logger.debug("DesignatedWainter.run: containsDesignated = " + containsDesignated);
+ /*
+ * The list only contains designated. This is a problem. It is most likely a race
+ * condition that resulted in two thinking they should be designated. Choose the
+ * site with the latest designated date for the pdp not included on the designated list.
+ * This should be the site that had the last designation before this race condition
+ * occurred.
+ */
+ for(DroolsPdp pdp : pdps){
+ if(listOfDesignated.contains(pdp)){
+ continue; //Don't consider this entry
+ }
+ if(pdp.getDesignatedDate().compareTo(mostRecentPrimary.getDesignatedDate()) > 0){
+ mostRecentPrimary = pdp;
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run mostRecentPrimary = " + mostRecentPrimary.getPdpId());
+ }
+ }
+ }else{
+ logger.debug("DesignatedWainter.run: containsDesignated = " + containsDesignated);
+ //The list only contains hot standby. Choose the site of the latest designated date
+ for(DroolsPdp pdp : pdps){
+ if(pdp.getDesignatedDate().compareTo(mostRecentPrimary.getDesignatedDate()) > 0){
+ mostRecentPrimary = pdp;
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run mostRecentPrimary = " + mostRecentPrimary.getPdpId());
+ }
+ }
+ }
+ }
+ return mostRecentPrimary;
+ }
+
+ public DroolsPdp computeDesignatedPdp(ArrayList<DroolsPdp> listOfDesignated, DroolsPdp mostRecentPrimary){
+ DroolsPdp designatedPdp = null;
+ DroolsPdp lowestPriorityPdp = null;
+ if(listOfDesignated.size() > 1){
+ logger.debug
+ //System.out.println
+ ("DesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated.size(): " + listOfDesignated.size());
+ DroolsPdp rejectedPdp = null;
+ DroolsPdp lowestPrioritySameSite = null;
+ DroolsPdp lowestPriorityDifferentSite = null;
+ for(DroolsPdp pdp : listOfDesignated){
+ // We need to determine if another PDP is the lowest priority
+ if(nullSafeEquals(pdp.getSiteName(),mostRecentPrimary.getSiteName())){
+ if(lowestPrioritySameSite == null){
+ if(lowestPriorityDifferentSite != null){
+ rejectedPdp = lowestPriorityDifferentSite;
+ }
+ lowestPrioritySameSite = pdp;
+ }else{
+ if(pdp.getPdpId().equals((lowestPrioritySameSite.getPdpId()))){
+ continue;//nothing to compare
+ }
+ if(pdp.comparePriority(lowestPrioritySameSite) <0){
+ logger.debug
+ //System.out.println
+ ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
+ + " has lower priority than pdp ID: " + lowestPrioritySameSite.getPdpId());
+
+ //we need to reject lowestPrioritySameSite
+ rejectedPdp = lowestPrioritySameSite;
+ lowestPrioritySameSite = pdp;
+ } else{
+ //we need to reject pdp and keep lowestPrioritySameSite
+ logger.debug
+ //System.out.println
+ ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
+ + " has higher priority than pdp ID: " + lowestPrioritySameSite.getPdpId());
+ rejectedPdp = pdp;
+ }
+ }
+ } else{
+ if(lowestPrioritySameSite != null){
+ //if we already have a candidate for same site, we don't want to bother with different sites
+ rejectedPdp = pdp;
+ } else{
+ if(lowestPriorityDifferentSite == null){
+ lowestPriorityDifferentSite = pdp;
+ continue;
+ }
+ if(pdp.getPdpId().equals((lowestPriorityDifferentSite.getPdpId()))){
+ continue;//nothing to compare
+ }
+ if(pdp.comparePriority(lowestPriorityDifferentSite) <0){
+ logger.debug
+ //System.out.println
+ ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
+ + " has lower priority than pdp ID: " + lowestPriorityDifferentSite.getPdpId());
+
+ //we need to reject lowestPriorityDifferentSite
+ rejectedPdp = lowestPriorityDifferentSite;
+ lowestPriorityDifferentSite = pdp;
+ } else{
+ //we need to reject pdp and keep lowestPriorityDifferentSite
+ logger.debug
+ //System.out.println
+ ("\nDesignatedWaiter.run: myPdp" + myPdp.getPdpId() + " listOfDesignated pdp ID: " + pdp.getPdpId()
+ + " has higher priority than pdp ID: " + lowestPriorityDifferentSite.getPdpId());
+ rejectedPdp = pdp;
+ }
+ }
+ }
+ // If the rejectedPdp is myPdp, we need to stand it down and demote it. Each pdp is responsible
+ // for demoting itself
+ if(rejectedPdp != null && nullSafeEquals(rejectedPdp.getPdpId(),myPdp.getPdpId())){
+ logger.debug
+ //System.out.println
+ ("\n\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated myPdp ID: " + myPdp.getPdpId()
+ + " is NOT the lowest priority. Executing stateManagement.demote()" + "\n\n");
+ // We found that myPdp is on the listOfDesignated and it is not the lowest priority
+ // So, we must demote it
+ try {
+ //Keep the order like this. StateManagement is last since it triggers controller shutdown
+ myPdp.setDesignated(false);
+ pdpsConnector.setDesignated(myPdp, false);
+ isDesignated = false;
+ String standbyStatus = stateManagement.getStandbyStatus();
+ if(!(standbyStatus.equals(StateManagement.HOT_STANDBY) ||
+ standbyStatus.equals(StateManagement.COLD_STANDBY))){
+ /*
+ * Only call demote if it is not already in the right state. Don't worry about
+ * synching the lower level topic endpoint states. That is done by the
+ * refreshStateAudit.
+ */
+ stateManagement.demote();
+ }
+ } catch (Exception e) {
+ myPdp.setDesignated(false);
+ pdpsConnector.setDesignated(myPdp, false);
+ isDesignated = false;
+ logger.error
+ //System.out.println
+ ("DesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " Caught Exception attempting to demote myPdp'"
+ + myPdp.getPdpId()
+ + "', message="
+ + e.getMessage());
+ System.out.println(new Date() + " DesignatedWaiter.run: caught unexpected exception "
+ + "from stateManagement.demote()");
+ e.printStackTrace();
+ }
+ }
+ } //end: for(DroolsPdp pdp : listOfDesignated)
+ if(lowestPrioritySameSite != null){
+ lowestPriorityPdp = lowestPrioritySameSite;
+ } else {
+ lowestPriorityPdp = lowestPriorityDifferentSite;
+ }
+ //now we have a valid value for lowestPriorityPdp
+ logger.debug
+ //System.out.println
+ ("\n\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated found the LOWEST priority pdp ID: "
+ + lowestPriorityPdp.getPdpId()
+ + " It is now the designatedPpd from the perspective of myPdp ID: " + myPdp + "\n\n");
+ designatedPdp = lowestPriorityPdp;
+
+ } else if(listOfDesignated.isEmpty()){
+ logger.debug
+ //System.out.println
+ ("\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated is: EMPTY.");
+ designatedPdp = null;
+ } else{ //only one in listOfDesignated
+ logger.debug
+ //System.out.println
+ ("\nDesignatedWaiter.run: myPdp: " + myPdp.getPdpId() + " listOfDesignated has ONE entry. PDP ID: "
+ + listOfDesignated.get(0).getPdpId());
+ designatedPdp = listOfDesignated.get(0);
+ }
+ return designatedPdp;
+
+ }
+
private class TimerUpdateClass extends TimerTask{
@Override
@@ -926,7 +1064,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker {
long nowModMs = nowMs % pdpUpdateInterval;
// Time to the start of the next pdpUpdateInterval multiple
- long startMs = pdpUpdateInterval - nowModMs;
+ long startMs = 2*pdpUpdateInterval - nowModMs;
// Give the start time a minimum of a 5 second cushion
if(startMs < 5000){
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/JpaDroolsPdpsConnector.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/JpaDroolsPdpsConnector.java
index ac9255a2..d2032895 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/JpaDroolsPdpsConnector.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/JpaDroolsPdpsConnector.java
@@ -27,6 +27,7 @@ import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
+import javax.persistence.FlushModeType;
import javax.persistence.LockModeType;
import javax.persistence.Query;
@@ -54,7 +55,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
try {
em.getTransaction().begin();
Query droolsPdpsListQuery = em.createQuery("SELECT p FROM DroolsPdpEntity p");
- List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(LockModeType.PESSIMISTIC_READ).getResultList();
+ List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
LinkedList<DroolsPdp> droolsPdpsReturnList = new LinkedList<DroolsPdp>();
for(Object o : droolsPdpsList){
if(o instanceof DroolsPdp){
@@ -105,7 +106,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
em.getTransaction().begin();
Query droolsPdpsListQuery = em.createQuery("SELECT p FROM DroolsPdpEntity p WHERE p.pdpId=:pdpId");
droolsPdpsListQuery.setParameter("pdpId", pdp.getPdpId());
- List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(LockModeType.PESSIMISTIC_WRITE).getResultList();
+ List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
//em.getTransaction().begin();
DroolsPdpEntity droolsPdpEntity;
if(droolsPdpsList.size() == 1 && (droolsPdpsList.get(0) instanceof DroolsPdpEntity)){
@@ -210,7 +211,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
em.getTransaction().begin();
Query droolsPdpsListQuery = em.createQuery("SELECT p FROM DroolsPdpEntity p WHERE p.pdpId=:pdpId");
droolsPdpsListQuery.setParameter("pdpId", pdp.getPdpId());
- List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(LockModeType.PESSIMISTIC_WRITE).getResultList();
+ List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
if(droolsPdpsList.size() == 1 && droolsPdpsList.get(0) instanceof DroolsPdpEntity){
if (logger.isDebugEnabled()) {
logger.debug("isPdpCurrent: PDP=" + pdp.getPdpId() + " designated but not current; setting designated to false");
@@ -254,7 +255,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
.createQuery("SELECT p FROM DroolsPdpEntity p WHERE p.pdpId=:pdpId");
droolsPdpsListQuery.setParameter("pdpId", pdp.getPdpId());
List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(
- LockModeType.PESSIMISTIC_WRITE).getResultList();
+ LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
if (droolsPdpsList.size() == 1
&& droolsPdpsList.get(0) instanceof DroolsPdpEntity) {
DroolsPdpEntity droolsPdpEntity = (DroolsPdpEntity) droolsPdpsList
@@ -306,7 +307,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
.createQuery("SELECT p FROM DroolsPdpEntity p WHERE p.pdpId=:pdpId");
droolsPdpsListQuery.setParameter("pdpId", pdpId);
List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(
- LockModeType.PESSIMISTIC_WRITE).getResultList();
+ LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
DroolsPdpEntity droolsPdpEntity;
if (droolsPdpsList.size() == 1
&& (droolsPdpsList.get(0) instanceof DroolsPdpEntity)) {
@@ -460,7 +461,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
.createQuery("SELECT p FROM DroolsPdpEntity p WHERE p.pdpId=:pdpId");
droolsPdpsListQuery.setParameter("pdpId", pdpId);
List<?> droolsPdpsList = droolsPdpsListQuery.setLockMode(
- LockModeType.PESSIMISTIC_WRITE).getResultList();
+ LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
if (droolsPdpsList.size() == 1
&& droolsPdpsList.get(0) instanceof DroolsPdpEntity) {
droolsPdpEntity = (DroolsPdpEntity) droolsPdpsList.get(0);
@@ -553,7 +554,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
.createQuery("SELECT p FROM DroolsPdpEntity p");
@SuppressWarnings("unchecked")
List<DroolsPdp> droolsPdpsList = droolsPdpsListQuery.setLockMode(
- LockModeType.NONE).getResultList();
+ LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
logger.info("deleteAllPdps: Deleting " + droolsPdpsList.size() + " PDPs");
for (DroolsPdp droolsPdp : droolsPdpsList) {
String pdpId = droolsPdp.getPdpId();
@@ -634,7 +635,7 @@ public class JpaDroolsPdpsConnector implements DroolsPdpsConnector {
.createQuery("SELECT p FROM DroolsSessionEntity p");
@SuppressWarnings("unchecked")
List<DroolsSession> droolsSessionsList = droolsSessionListQuery.setLockMode(
- LockModeType.NONE).getResultList();
+ LockModeType.NONE).setFlushMode(FlushModeType.COMMIT).getResultList();
logger.info("deleteAllSessions: Deleting " + droolsSessionsList.size() + " Sessions");
for (DroolsSession droolsSession : droolsSessionsList) {
logger.info("deleteAllSessions: Deleting droolsSession with pdpId="
diff --git a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/PersistenceFeature.java b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/PersistenceFeature.java
index e2c7f402..e592220e 100644
--- a/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/PersistenceFeature.java
+++ b/policy-persistence/src/main/java/org/openecomp/policy/drools/persistence/PersistenceFeature.java
@@ -43,10 +43,11 @@ import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
import org.openecomp.policy.common.logging.flexlogger.PropertyUtil;
import org.openecomp.policy.drools.core.DroolsPDPIntegrityMonitor;
-import org.openecomp.policy.drools.core.FeatureAPI;
+import org.openecomp.policy.drools.core.PolicySessionFeatureAPI;
import org.openecomp.policy.drools.core.IntegrityMonitorProperties;
import org.openecomp.policy.drools.core.PolicyContainer;
import org.openecomp.policy.drools.core.PolicySession;
+import org.openecomp.policy.drools.features.PolicyEngineFeatureAPI;
import org.openecomp.policy.drools.im.PMStandbyStateChangeNotifier;
import org.openecomp.policy.drools.system.PolicyEngine;
@@ -64,7 +65,7 @@ import bitronix.tm.resource.jdbc.PoolingDataSource;
* 'PolicyContainer' and 'Main'. It was moved here as part of making this
* a separate optional feature.
*/
-public class PersistenceFeature implements FeatureAPI
+public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngineFeatureAPI
{
// get an instance of logger
private static Logger logger =
@@ -199,88 +200,116 @@ public class PersistenceFeature implements FeatureAPI
getContainerAdjunct(policySession.getPolicyContainer())
.destroyKieSession();
}
-
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void beforeStartEngine()
- {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void afterStartEngine()
- {
- PolicyEngine.manager.lock();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void beforeShutdownEngine()
- {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void beforeCreateController(String name, Properties properties)
- {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void afterCreateController(String name)
- {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void afterShutdownEngine()
- {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void beforeStartController(String name)
- {
- return;
- }
/**
* {@inheritDoc}
*/
@Override
- public void afterStartController(String name)
+ public boolean isPersistenceEnabled()
{
- return;
+ return(!persistenceDisabled);
}
-
+
/**
* {@inheritDoc}
*/
@Override
- public boolean isPersistenceEnabled()
+ public boolean afterStart(PolicyEngine engine)
{
- return(!persistenceDisabled);
+ // ASSERTION: engine == PolicyEngine.manager
+ PolicyEngine.manager.lock();
+ return false;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeStart(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeShutdown(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterShutdown(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeConfigure(PolicyEngine engine, Properties properties) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterConfigure(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeActivate(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterActivate(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeDeactivate(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterDeactivate(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeStop(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterStop(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeLock(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterLock(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeUnlock(PolicyEngine engine) {return false;}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterUnlock(PolicyEngine engine) {return false;}
/**************************/
diff --git a/policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI b/policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.PolicySessionFeatureAPI
index 540a4bd4..540a4bd4 100644
--- a/policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI
+++ b/policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.PolicySessionFeatureAPI
diff --git a/policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI b/policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI
new file mode 100644
index 00000000..540a4bd4
--- /dev/null
+++ b/policy-persistence/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI
@@ -0,0 +1 @@
+org.openecomp.policy.drools.persistence.PersistenceFeature
diff --git a/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/ResiliencyTestCases.java b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/ResiliencyTestCases.java
deleted file mode 100644
index f58d304e..00000000
--- a/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/ResiliencyTestCases.java
+++ /dev/null
@@ -1,1267 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * policy-persistence
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.policy.drools.controller.test;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.Persistence;
-
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.openecomp.policy.common.logging.eelf.PolicyLogger;
-import org.openecomp.policy.common.im.AdministrativeStateException;
-import org.openecomp.policy.common.im.IntegrityMonitor;
-import org.openecomp.policy.common.im.StandbyStatusException;
-import org.openecomp.policy.common.im.StateManagement;
-import org.openecomp.policy.drools.core.DroolsPDPIntegrityMonitor;
-import org.openecomp.policy.drools.core.IntegrityMonitorProperties;
-import org.openecomp.policy.drools.core.PolicyContainer;
-import org.openecomp.policy.drools.im.PMStandbyStateChangeNotifier;
-import org.openecomp.policy.drools.persistence.DroolsPdp;
-import org.openecomp.policy.drools.persistence.DroolsPdpEntity;
-import org.openecomp.policy.drools.persistence.DroolsPdpImpl;
-import org.openecomp.policy.drools.persistence.DroolsPdpsConnector;
-import org.openecomp.policy.drools.persistence.JpaDroolsPdpsConnector;
-import org.openecomp.policy.drools.persistence.DroolsPersistenceProperties;
-import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
-import org.openecomp.policy.drools.system.Main;
-import org.openecomp.policy.drools.system.PolicyEngine;
-
-import org.apache.commons.lang3.time.DateUtils;
-
-/*
- * Cloned from StandbyStateManagement.java in support of US673632.
- * See MultiSite_v1-10.ppt, slide 38
- */
-public class ResiliencyTestCases {
-
- /*
- * Currently, the DroolsPdpsElectionHandler.DesignationWaiter is invoked every ten seconds, starting
- * at ten seconds after the minute boundary (e.g. 13:05:10). So, an 80 second sleep should be
- * sufficient to ensure that we wait for the DesignationWaiter to do its job, before
- * checking the results.
- */
- long sleepTime = 80000;
-
- /*
- * DroolsPdpsElectionHandler runs every ten seconds, so a 15 second sleep should be
- * plenty to ensure it has time to re-promote this PDP.
- */
- long electionWaitSleepTime = 15000;
-
- /*
- * Sleep 5 seconds after each test to allow interrupt (shutdown) recovery.
- */
- long interruptRecoveryTime = 5000;
-
- /*
- * See the IntegrityMonitor.getJmxUrl() method for the rationale behind this jmx related processing.
- */
- @BeforeClass
- public static void setUpClass() throws Exception {
-
- String userDir = System.getProperty("user.dir");
- PolicyLogger.debug("setUpClass: userDir=" + userDir);
- System.setProperty("com.sun.management.jmxremote.port", "9980");
- System.setProperty("com.sun.management.jmxremote.authenticate","false");
-
- // Make sure path to config directory is set correctly in PolicyContainer.main
- // Also make sure we ignore HTTP server failures resulting from port conflicts.
- PolicyContainer.isUnitTesting = true;
-
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- }
-
- @Before
- public void setUp() throws Exception {
- }
-
- @After
- public void tearDown() throws Exception {
-
- }
-
- public void cleanDroolsDB() throws Exception{
- PolicyLogger.debug("\n\ncleanDroolsDB: Entering\n\n");
-
- PolicyLogger.debug("cleanDroolsDB: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
-
- PolicyLogger.debug("cleanDroolsDB: Creating emfDrools");
- EntityManagerFactory emf = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- PolicyLogger.debug("cleanDroolsDB: Cleaning up tables");
-
- EntityManager em = emf.createEntityManager();
- EntityTransaction et = em.getTransaction();
- et.begin();
-
- // Make sure the DB is clean
- PolicyLogger.debug("cleanDroolsDB: clean DroolsPdpEntity");
- em.createQuery("DELETE FROM DroolsPdpEntity").executeUpdate();
- PolicyLogger.debug("cleanDroolsDB: clean DroolsSessionEntity");
- em.createQuery("DELETE FROM DroolsSessionEntity").executeUpdate();
-
- em.flush();
- PolicyLogger.debug("cleanDroolsDB: after flush");
-
- et.commit();
-
- PolicyLogger.debug("\n\ncleanDroolsDB: Exiting\n\n");
- }
-
- public void cleanXacmlDB() throws Exception {
- PolicyLogger.debug("\n\ncleanXacmlDB: Entering\n\n");
-
- PolicyLogger.debug("cleanXacmlDB: Reading IntegrityMonitorProperties");
-
- PolicyLogger.debug("cleanXacmlDB: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
-
- PolicyLogger.debug("cleanXacmlDB: Creating emf");
- EntityManagerFactory emf = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- EntityManager em = emf.createEntityManager();
- EntityTransaction et = em.getTransaction();
- et.begin();
-
- // Make sure the DB is clean
- PolicyLogger.debug("cleanXacmlDB: clean StateManagementEntity");
- em.createQuery("DELETE FROM StateManagementEntity").executeUpdate();
- PolicyLogger.debug("cleanXacmlDB: clean ResourceRegistrationEntity");
- em.createQuery("DELETE FROM ResourceRegistrationEntity").executeUpdate();
- PolicyLogger.debug("cleanXacmlDB: clean ForwardProgressEntity");
- em.createQuery("DELETE FROM ForwardProgressEntity").executeUpdate();
-
- em.flush();
- PolicyLogger.debug("cleandXacmlDB: after flush");
-
- et.commit();
-
- PolicyLogger.debug("\n\ncleanXacmlDB: Exiting\n\n");
-
- }
-
- @Ignore
- @Test
- public void singleNodeTests() throws Exception{
- //snNewInstall();
- snNewInstallBadDepData();
- /*snRecoveryFromBadDepData();
- snLock();
- snLockRestart();
- snUnlock();
- snUnlockRestart();*/
- }
-
- @Ignore
- @Test
- public void twoNodeTests() throws Exception{
- tnNewInstall();
- tnLockActive();
- tnUnlockColdStandby();
- tnFailActive();
- tnRecoverFailed();
- }
-
- @Ignore
- @Test
- public void twoSitesTwoNodesPerSiteTests() throws Exception{
- tstnNewInstall();
- tstnLock1Site1();
- tstnLock2Site1();
- tstnFailActiveSite2();
- tstnRecoverFailedSite2();
- tstnUnlockSite1();
- tstnFailSite2();
- }
-
-
- /*
- * Single Node Tests
- */
- public void snNewInstall() throws Exception{
- PolicyLogger.debug("\n\nsnNewInstall: Entry\n\n");
- cleanDroolsDB();
- cleanXacmlDB();
-
- //*******************************************
-
- PolicyLogger.debug("snNewInstall: Reading IntegrityMonitorProperties");
- Properties integrityMonitorProperties = new Properties();
- integrityMonitorProperties.load(new FileInputStream(new File(
- "src/test/server/config/IntegrityMonitor.properties")));
- IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
- String thisPdpId = IntegrityMonitorProperties
- .getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
-
- PolicyLogger.debug("snNewInstall: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
- XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
-
- PolicyLogger.debug("snNewInstall: Creating emfXacml");
- EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- PolicyLogger.debug("snNewInstall: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
- DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
-
- PolicyLogger.debug("snNewInstall: Creating emfDrools");
- EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
-
- PolicyLogger.debug("snNewInstall: Inserting PDP=" + thisPdpId + " as designated");
- DroolsPdp pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
- conn.insertPdp(pdp);
- DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("snNewInstall: After insertion, DESIGNATED="
- + droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
- assertTrue(droolsPdpEntity.isDesignated() == true);
-
- /*
- * When the Standby Status changes (from providingservice) to hotstandby
- * or coldstandby,the Active/Standby selection algorithm must stand down
- * if thePDP-D is currently the lead/active node and allow another PDP-D
- * to take over.
- *
- * It must also call lock on all engines in the engine management.
- *
- */
- PolicyLogger.debug("snNewInstall: Instantiating stateManagement object");
- StateManagement sm = new StateManagement(emfXacml, thisPdpId);
- PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
- sm.addObserver(pmStandbyStateChangeNotifier);
-
- // Artificially putting a PDP into service is really a two step process, 1)
- // inserting it as designated and 2) promoting it so that its standbyStatus
- // is providing service.
-
- PolicyLogger.debug("snNewInstall: Running policy-management.Main class");
- PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
- policyManagementRunner.start();
-
- PolicyLogger.debug("snNewInstall: Runner started; Sleeping "
- + interruptRecoveryTime + "ms before promoting PDP="
- + thisPdpId);
- Thread.sleep(interruptRecoveryTime);
-
- PolicyLogger.debug("snNewInstall: Promoting PDP=" + thisPdpId);
- sm.promote();
-
- String standbyStatus = sm.getStandbyStatus(thisPdpId);
- PolicyLogger.debug("snNewInstall: Before locking, PDP=" + thisPdpId + " has standbyStatus="
- + standbyStatus);
-
- PolicyLogger.debug("snNewInstall: Locking sm");
- sm.lock();
-
- Thread.sleep(interruptRecoveryTime);
- /*
- * Verify that the PDP is no longer designated.
- */
- droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("snNewInstall: After lock sm.lock() invoked, DESIGNATED="
- + droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
- assertTrue(droolsPdpEntity.isDesignated() == false);
-
- PolicyLogger.debug("snNewInstall: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
-
- PolicyLogger.debug("\n\nsnNewInstall: Exiting\n\n");
- Thread.sleep(interruptRecoveryTime);
-
- //********************************************
-
- PolicyLogger.debug("\n\nsnNewInstall: Exit\n\n");
- }
-
- public void snNewInstallBadDepData() throws Exception{
- PolicyLogger.debug("\n\nsnNewInstallBadDepData: Entry\n\n");
- cleanDroolsDB();
- cleanXacmlDB();
-
- //*******************************************
-
- PolicyLogger.debug("snNewInstallBadDepData: Reading IntegrityMonitor_BadDependencyData.properties");
- Properties integrityMonitorProperties = new Properties();
- integrityMonitorProperties.load(new FileInputStream(new File(
- "src/test/server/config/IntegrityMonitor_BadDependencyData.properties")));
- IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
- String thisPdpId = IntegrityMonitorProperties
- .getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
-
- PolicyLogger.debug("snNewInstallBadDepData: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
- XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
-
- PolicyLogger.debug("snNewInstallBadDepData: Creating emfXacml");
- EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- PolicyLogger.debug("snNewInstallBadDepData: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
- DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
-
- PolicyLogger.debug("snNewInstallBadDepData: Creating emfDrools");
- EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
-
- PolicyLogger.debug("snNewInstallBadDepData: Inserting PDP=" + thisPdpId + " as designated");
- DroolsPdp pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
- conn.insertPdp(pdp);
- DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
- //PolicyLogger.debug
- System.out.println
- ("\n\nsnNewInstallBadDepData: After insertion, DESIGNATED="
- + droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId + "\n\n********************");
- assertTrue(droolsPdpEntity.isDesignated() == true);
-
- /*
- * When the Standby Status changes (from providingservice) to hotstandby
- * or coldstandby,the Active/Standby selection algorithm must stand down
- * if thePDP-D is currently the lead/active node and allow another PDP-D
- * to take over.
- */
- PolicyLogger.debug("snNewInstall: Instantiating stateManagement object");
- StateManagement sm = new StateManagement(emfXacml, thisPdpId);
- PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
- sm.addObserver(pmStandbyStateChangeNotifier);
-
- // Artificially putting a PDP into service is really a two step process, 1)
- // inserting it as designated and 2) promoting it so that its standbyStatus
- // is providing service.
-
- PolicyLogger.debug("snNewInstall: Running policy-management.Main class");
- PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
- policyManagementRunner.start();
-
- PolicyLogger.debug("snNewInstall: Runner started; Sleeping "
- + interruptRecoveryTime + "ms before promoting PDP="
- + thisPdpId);
- Thread.sleep(interruptRecoveryTime);
-
- PolicyLogger.debug("snNewInstall: Promoting PDP=" + thisPdpId);
- sm.promote();
-
- String standbyStatus = sm.getStandbyStatus(thisPdpId);
- PolicyLogger.debug("snNewInstall: Before locking, PDP=" + thisPdpId + " has standbyStatus="
- + standbyStatus);
-
- /*
- * Verify that the PDP is no longer designated.
- */
- droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("snNewInstall: After lock sm.lock() invoked, DESIGNATED="
- + droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
- assertTrue(droolsPdpEntity.isDesignated() == false);
-
- PolicyLogger.debug("snNewInstall: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
-
- PolicyLogger.debug("\n\nsnNewInstall: Exiting\n\n");
- Thread.sleep(interruptRecoveryTime);
-
- //********************************************
-
- PolicyLogger.debug("\n\nsnNewInstallBadDepData: Exit\n\n");
- }
-
- public void snRecoveryFromBadDepData() throws Exception{
-
- }
-
- public void snLock() throws Exception {
-
- }
-
- public void snLockRestart() throws Exception {
-
- }
-
- public void snUnlock() throws Exception {
-
- }
-
- public void snUnlockRestart() throws Exception {
-
- }
-
- /*
- * Two Nodes tests
- */
- public void tnNewInstall() throws Exception {
-
- }
-
- public void tnLockActive() throws Exception {
-
- }
-
- public void tnUnlockColdStandby() throws Exception {
-
- }
-
- public void tnFailActive() throws Exception {
-
- }
-
- public void tnRecoverFailed() throws Exception {
-
- }
-
- /*
- * Two Sites, Two Nodes Each Site tests
- */
-
- public void tstnNewInstall() throws Exception {
-
- }
-
- public void tstnLock1Site1() throws Exception {
-
- }
-
- public void tstnLock2Site1() throws Exception {
-
- }
-
- public void tstnFailActiveSite2() throws Exception {
-
- }
-
- public void tstnRecoverFailedSite2() throws Exception {
-
- }
-
- public void tstnUnlockSite1() throws Exception {
-
- }
-
- public void tstnFailSite2() throws Exception {
-
- }
-
-
- @Ignore
- @Test
- public void testColdStandby() throws Exception {
-
- PolicyLogger.debug("\n\ntestColdStandby: Entering\n\n");
-
- PolicyLogger.debug("testColdStandby: Reading IntegrityMonitorProperties");
- Properties integrityMonitorProperties = new Properties();
- integrityMonitorProperties.load(new FileInputStream(new File(
- "src/test/server/config/IntegrityMonitor.properties")));
- IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
- String thisPdpId = IntegrityMonitorProperties
- .getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
-
- PolicyLogger.debug("testColdStandby: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
- XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
-
- PolicyLogger.debug("testColdStandby: Creating emfXacml");
- EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- PolicyLogger.debug("testColdStandby: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
- DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
-
- PolicyLogger.debug("testColdStandby: Creating emfDrools");
- EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
-
- PolicyLogger.debug("testColdStandby: Cleaning up tables");
- conn.deleteAllSessions();
- conn.deleteAllPdps();
-
- PolicyLogger.debug("testColdStandby: Inserting PDP=" + thisPdpId + " as designated");
- DroolsPdp pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
- conn.insertPdp(pdp);
- DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testColdStandby: After insertion, DESIGNATED="
- + droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
- assertTrue(droolsPdpEntity.isDesignated() == true);
-
- /*
- * When the Standby Status changes (from providingservice) to hotstandby
- * or coldstandby,the Active/Standby selection algorithm must stand down
- * if thePDP-D is currently the lead/active node and allow another PDP-D
- * to take over.
- *
- * It must also call lock on all engines in the engine management.
- *
- * Yes, this is kludgy, but we have a chicken and egg problem here: we
- * need a StateManagement object to invoke the
- * deleteAllStateManagementEntities method.
- */
- PolicyLogger.debug("testColdStandby: Instantiating stateManagement object");
- StateManagement sm = new StateManagement(emfXacml, "dummy");
- sm.deleteAllStateManagementEntities();
- sm = new StateManagement(emfXacml, thisPdpId);
- PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
- sm.addObserver(pmStandbyStateChangeNotifier);
-
- // Artificially putting a PDP into service is really a two step process, 1)
- // inserting it as designated and 2) promoting it so that its standbyStatus
- // is providing service.
-
- PolicyLogger.debug("testColdStandby: Running policy-management.Main class");
- PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
- policyManagementRunner.start();
-
- PolicyLogger.debug("testColdStandby: Runner started; Sleeping "
- + interruptRecoveryTime + "ms before promoting PDP="
- + thisPdpId);
- Thread.sleep(interruptRecoveryTime);
-
- PolicyLogger.debug("testColdStandby: Promoting PDP=" + thisPdpId);
- sm.promote();
-
- String standbyStatus = sm.getStandbyStatus(thisPdpId);
- PolicyLogger.debug("testColdStandby: Before locking, PDP=" + thisPdpId + " has standbyStatus="
- + standbyStatus);
-
- PolicyLogger.debug("testColdStandby: Locking sm");
- sm.lock();
-
- Thread.sleep(interruptRecoveryTime);
- /*
- * Verify that the PDP is no longer designated.
- */
- droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testColdStandby: After lock sm.lock() invoked, DESIGNATED="
- + droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
- assertTrue(droolsPdpEntity.isDesignated() == false);
-
- PolicyLogger.debug("testColdStandby: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
-
- PolicyLogger.debug("\n\ntestColdStandby: Exiting\n\n");
- Thread.sleep(interruptRecoveryTime);
-
- }
-
- /*
- * Tests hot standby when there is only one PDP.
- */
- @Ignore
- @Test
- public void testHotStandby1() throws Exception {
-
- PolicyLogger.debug("\n\ntestHotStandby1: Entering\n\n");
-
- PolicyLogger.debug("testHotStandby1: Reading IntegrityMonitorProperties");
- Properties integrityMonitorProperties = new Properties();
- integrityMonitorProperties.load(new FileInputStream(new File(
- "src/test/server/config/IntegrityMonitor.properties")));
- IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
- String thisPdpId = IntegrityMonitorProperties
- .getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
-
- PolicyLogger.debug("testHotStandby1: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
- XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
-
- PolicyLogger.debug("testHotStandby1: Creating emfXacml");
- EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- PolicyLogger.debug("testHotStandby1: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
- DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
-
- PolicyLogger.debug("testHotStandby1: Creating emfDrools");
- EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
-
- PolicyLogger.debug("testHotStandby1: Cleaning up tables");
- conn.deleteAllSessions();
- conn.deleteAllPdps();
-
- /*
- * Insert this PDP as not designated. Initial standby state will be
- * either null or cold standby. Demoting should transit state to
- * hot standby.
- */
- PolicyLogger.debug("testHotStandby1: Inserting PDP=" + thisPdpId + " as not designated");
- Date yesterday = DateUtils.addDays(new Date(), -1);
- DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, false, 4, yesterday);
- conn.insertPdp(pdp);
- DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testHotStandby1: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
- + droolsPdpEntity.isDesignated());
- assertTrue(droolsPdpEntity.isDesignated() == false);
-
- PolicyLogger.debug("testHotStandby1: Instantiating stateManagement object");
- StateManagement sm = new StateManagement(emfXacml, "dummy");
- sm.deleteAllStateManagementEntities();
- sm = new StateManagement(emfXacml, thisPdpId);
- PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
- sm.addObserver(pmStandbyStateChangeNotifier);
-
- PolicyLogger.debug("testHotStandby1: Demoting PDP=" + thisPdpId);
- // demoting should cause state to transit to hotstandby
- sm.demote();
-
- PolicyLogger.debug("testHotStandby1: Running policy-management.Main class");
- PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
- policyManagementRunner.start();
-
- PolicyLogger.debug("testHotStandby1: Sleeping "
- + sleepTime
- + "ms, to allow JpaDroolsPdpsConnector time to check droolspdpentity table");
- Thread.sleep(sleepTime);
-
- /*
- * Verify that this formerly un-designated PDP in HOT_STANDBY is now designated and providing service.
- */
- droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testHotStandby1: After sm.demote() invoked, DESIGNATED="
- + droolsPdpEntity.isDesignated() + " for PDP=" + thisPdpId);
- assertTrue(droolsPdpEntity.isDesignated() == true);
- String standbyStatus = sm.getStandbyStatus(thisPdpId);
- PolicyLogger.debug("testHotStandby1: After demotion, PDP=" + thisPdpId + " has standbyStatus="
- + standbyStatus);
- assertTrue(standbyStatus != null && standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
-
- PolicyLogger.debug("testHotStandby1: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
-
- PolicyLogger.debug("\n\ntestHotStandby1: Exiting\n\n");
- Thread.sleep(interruptRecoveryTime);
-
- }
-
- /*
- * Tests hot standby when two PDPs are involved.
- */
- @Ignore
- @Test
- public void testHotStandby2() throws Exception {
-
- PolicyLogger.debug("\n\ntestHotStandby2: Entering\n\n");
-
- PolicyLogger.debug("testHotStandby2: Reading IntegrityMonitorProperties");
- Properties integrityMonitorProperties = new Properties();
- integrityMonitorProperties.load(new FileInputStream(new File(
- "src/test/server/config/IntegrityMonitor.properties")));
- IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
- String thisPdpId = IntegrityMonitorProperties
- .getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
-
- PolicyLogger.debug("testHotStandby2: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
- XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
-
- PolicyLogger.debug("testHotStandby2: Creating emfXacml");
- EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- PolicyLogger.debug("testHotStandby2: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
- DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
-
- PolicyLogger.debug("testHotStandby2: Creating emfDrools");
- EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
-
- PolicyLogger.debug("testHotStandby2: Cleaning up tables");
- conn.deleteAllSessions();
- conn.deleteAllPdps();
-
- /*
- * Insert a PDP that's designated but not current.
- */
- String activePdpId = "pdp2";
- PolicyLogger.debug("testHotStandby2: Inserting PDP=" + activePdpId + " as stale, designated PDP");
- Date yesterday = DateUtils.addDays(new Date(), -1);
- DroolsPdp pdp = new DroolsPdpImpl(activePdpId, true, 4, yesterday);
- conn.insertPdp(pdp);
- DroolsPdpEntity droolsPdpEntity = conn.getPdp(activePdpId);
- PolicyLogger.debug("testHotStandby2: After insertion, PDP=" + activePdpId + ", which is not current, has DESIGNATED="
- + droolsPdpEntity.isDesignated());
- assertTrue(droolsPdpEntity.isDesignated() == true);
-
- /*
- * Promote the designated PDP.
- *
- * We have a chicken and egg problem here: we need a StateManagement
- * object to invoke the deleteAllStateManagementEntities method.
- */
- PolicyLogger.debug("testHotStandy2: Promoting PDP=" + activePdpId);
- StateManagement sm = new StateManagement(emfXacml, "dummy");
- sm.deleteAllStateManagementEntities();
- sm = new StateManagement(emfXacml, activePdpId);
- PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
- sm.addObserver(pmStandbyStateChangeNotifier);
-
- // Artificially putting a PDP into service is really a two step process, 1)
- // inserting it as designated and 2) promoting it so that its standbyStatus
- // is providing service.
-
- /*
- * Insert this PDP as not designated. Initial standby state will be
- * either null or cold standby. Demoting should transit state to
- * hot standby.
- */
- PolicyLogger.debug("testHotStandby2: Inserting PDP=" + thisPdpId + " as not designated");
- pdp = new DroolsPdpImpl(thisPdpId, false, 4, yesterday);
- conn.insertPdp(pdp);
- droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testHotStandby2: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
- + droolsPdpEntity.isDesignated());
- assertTrue(droolsPdpEntity.isDesignated() == false);
-
- PolicyLogger.debug("testHotStandby2: Demoting PDP=" + thisPdpId);
- StateManagement sm2 = new StateManagement(emfXacml, thisPdpId);
- sm2.addObserver(pmStandbyStateChangeNotifier);
-
- PolicyLogger.debug("testHotStandby2: Running policy-management.Main class");
- PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
- policyManagementRunner.start();
-
- PolicyLogger.debug("testHotStandby2: Runner started; Sleeping "
- + interruptRecoveryTime + "ms before promoting/demoting");
- Thread.sleep(interruptRecoveryTime);
-
- PolicyLogger.debug("testHotStandby2: Runner started; promoting PDP=" + activePdpId);
- sm.promote();
- String standbyStatus = sm.getStandbyStatus(activePdpId);
- PolicyLogger.debug("testHotStandby2: After promoting, PDP=" + activePdpId + " has standbyStatus="
- + standbyStatus);
-
- // demoting PDP should ensure that state transits to hotstandby
- PolicyLogger.debug("testHotStandby2: Runner started; demoting PDP=" + thisPdpId);
- sm2.demote();
- standbyStatus = sm.getStandbyStatus(thisPdpId);
- PolicyLogger.debug("testHotStandby2: After demoting, PDP=" + thisPdpId + " has standbyStatus="
- + standbyStatus);
-
- PolicyLogger.debug("testHotStandby2: Sleeping "
- + sleepTime
- + "ms, to allow JpaDroolsPdpsConnector time to check droolspdpentity table");
- Thread.sleep(sleepTime);
-
- /*
- * Verify that this PDP, demoted to HOT_STANDBY, is now
- * re-designated and providing service.
- */
- droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testHotStandby2: After demoting PDP=" + activePdpId
- + ", DESIGNATED=" + droolsPdpEntity.isDesignated()
- + " for PDP=" + thisPdpId);
- assertTrue(droolsPdpEntity.isDesignated() == true);
- standbyStatus = sm2.getStandbyStatus(thisPdpId);
- PolicyLogger.debug("testHotStandby2: After demoting PDP=" + activePdpId
- + ", PDP=" + thisPdpId + " has standbyStatus=" + standbyStatus);
- assertTrue(standbyStatus != null
- && standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
-
- PolicyLogger.debug("testHotStandby2: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
-
- PolicyLogger.debug("\n\ntestHotStandby2: Exiting\n\n");
- Thread.sleep(interruptRecoveryTime);
-
- }
-
- /*
- * 1) Inserts and designates this PDP, then verifies that startTransaction
- * is successful.
- *
- * 2) Demotes PDP, and verifies that because there is only one PDP, it will
- * be immediately re-promoted, thus allowing startTransaction to be
- * successful.
- *
- * 3) Locks PDP and verifies that startTransaction results in
- * AdministrativeStateException.
- *
- * 4) Unlocks PDP and verifies that startTransaction results in
- * StandbyStatusException.
- *
- * 5) Promotes PDP and verifies that startTransaction is once again
- * successful.
- */
- @Ignore
- @Test
- public void testLocking1() throws Exception {
-
- PolicyLogger.debug("testLocking1: Reading IntegrityMonitorProperties");
- Properties integrityMonitorProperties = new Properties();
- integrityMonitorProperties.load(new FileInputStream(new File(
- "src/test/server/config/IntegrityMonitor.properties")));
- IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
- String thisPdpId = IntegrityMonitorProperties
- .getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
-
- PolicyLogger.debug("testLocking1: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
- XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
-
- PolicyLogger.debug("testLocking1: Creating emfXacml");
- EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- PolicyLogger.debug("testLocking1: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
- DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
-
- PolicyLogger.debug("testLocking1: Creating emfDrools");
- EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
-
- PolicyLogger.debug("testLocking1: Cleaning up tables");
- conn.deleteAllSessions();
- conn.deleteAllPdps();
-
- /*
- * Insert this PDP as designated. Initial standby state will be
- * either null or cold standby.
- */
- PolicyLogger.debug("testLocking1: Inserting PDP=" + thisPdpId + " as designated");
- DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, true, 4, new Date());
- conn.insertPdp(pdp);
- DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testLocking1: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
- + droolsPdpEntity.isDesignated());
- assertTrue(droolsPdpEntity.isDesignated() == true);
-
- PolicyLogger.debug("testLocking1: Instantiating stateManagement object");
- StateManagement sm = new StateManagement(emfXacml, "dummy");
- sm.deleteAllStateManagementEntities();
- sm = new StateManagement(emfXacml, thisPdpId);
- PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
- sm.addObserver(pmStandbyStateChangeNotifier);
-
- PolicyLogger.debug("testLocking1: Running policy-management.Main class, designated="
- + conn.getPdp(thisPdpId).isDesignated());
- PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
- policyManagementRunner.start();
-
- PolicyLogger.debug("testLocking1: Runner started; Sleeping "
- + interruptRecoveryTime + "ms before promoting PDP="
- + thisPdpId);
- Thread.sleep(interruptRecoveryTime);
-
- PolicyLogger.debug("testLocking1: Promoting PDP=" + thisPdpId);
- sm.promote();
-
- PolicyLogger.debug("testLocking1: Sleeping "
- + sleepTime
- + "ms, to allow time for policy-management.Main class to come up, designated="
- + conn.getPdp(thisPdpId).isDesignated());
- Thread.sleep(sleepTime);
-
- PolicyLogger.debug("testLocking1: Waking up and invoking startTransaction on active PDP="
- + thisPdpId
- + ", designated="
- + conn.getPdp(thisPdpId).isDesignated());
- DroolsPDPIntegrityMonitor droolsPdpIntegrityMonitor = (DroolsPDPIntegrityMonitor) IntegrityMonitor
- .getInstance();
- try {
- droolsPdpIntegrityMonitor.startTransaction();
- droolsPdpIntegrityMonitor.endTransaction();
- PolicyLogger.debug("testLocking1: As expected, transaction successful");
- } catch (AdministrativeStateException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
- assertTrue(false);
- } catch (StandbyStatusException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
- assertTrue(false);
- } catch (Exception e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
- assertTrue(false);
- }
-
- // demoting should cause state to transit to hotstandby, followed by re-promotion,
- // since there is only one PDP.
- PolicyLogger.debug("testLocking1: demoting PDP=" + thisPdpId);
- sm = droolsPdpIntegrityMonitor.getStateManager();
- sm.demote();
-
- PolicyLogger.debug("testLocking1: sleeping" + electionWaitSleepTime
- + " to allow election handler to re-promote PDP=" + thisPdpId);
- Thread.sleep(electionWaitSleepTime);
-
- PolicyLogger.debug("testLocking1: Invoking startTransaction on re-promoted PDP="
- + thisPdpId
- + ", designated="
- + conn.getPdp(thisPdpId).isDesignated());
- try {
- droolsPdpIntegrityMonitor.startTransaction();
- droolsPdpIntegrityMonitor.endTransaction();
- PolicyLogger.debug("testLocking1: As expected, transaction successful");
- } catch (AdministrativeStateException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
- assertTrue(false);
- } catch (StandbyStatusException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
- assertTrue(false);
- } catch (Exception e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
- assertTrue(false);
- }
-
- // locking should cause state to transit to cold standby
- PolicyLogger.debug("testLocking1: locking PDP=" + thisPdpId);
- sm.lock();
-
- // Just to avoid any race conditions, sleep a little after locking
- PolicyLogger.debug("testLocking1: Sleeping a few millis after locking, to avoid race condition");
- Thread.sleep(100);
-
- PolicyLogger.debug("testLocking1: Invoking startTransaction on locked PDP="
- + thisPdpId
- + ", designated="
- + conn.getPdp(thisPdpId).isDesignated());
- try {
- droolsPdpIntegrityMonitor.startTransaction();
- PolicyLogger.error("testLocking1: startTransaction unexpectedly successful");
- assertTrue(false);
- } catch (AdministrativeStateException e) {
- PolicyLogger.debug("testLocking1: As expected, caught AdministrativeStateException, message=" + e.getMessage());
- } catch (StandbyStatusException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
- assertTrue(false);
- } catch (Exception e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
- assertTrue(false);
- } finally {
- droolsPdpIntegrityMonitor.endTransaction();
- }
-
- // unlocking should cause state to transit to hot standby
- PolicyLogger.debug("testLocking1: unlocking PDP=" + thisPdpId);
- sm.unlock();
-
- // Just to avoid any race conditions, sleep a little after locking
- PolicyLogger.debug("testLocking1: Sleeping a few millis after unlocking, to avoid race condition");
- Thread.sleep(100);
-
- PolicyLogger.debug("testLocking1: Invoking startTransaction on unlocked PDP="
- + thisPdpId
- + ", designated="
- + conn.getPdp(thisPdpId).isDesignated());
- try {
- droolsPdpIntegrityMonitor.startTransaction();
- PolicyLogger.error("testLocking1: startTransaction unexpectedly successful");
- assertTrue(false);
- } catch (AdministrativeStateException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
- assertTrue(false);
- } catch (StandbyStatusException e) {
- PolicyLogger.debug("testLocking1: As expected, caught StandbyStatusException, message=" + e.getMessage());
- } catch (Exception e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
- assertTrue(false);
- } finally {
- droolsPdpIntegrityMonitor.endTransaction();
- }
-
- // promoting should cause state to transit to providing service
- PolicyLogger.debug("testLocking1: promoting PDP=" + thisPdpId);
- sm.promote();
-
- // Just to avoid any race conditions, sleep a little after promoting
- PolicyLogger.debug("testLocking1: Sleeping a few millis after promoting, to avoid race condition");
- Thread.sleep(100);
-
- PolicyLogger.debug("testLocking1: Invoking startTransaction on promoted PDP="
- + thisPdpId
- + ", designated="
- + conn.getPdp(thisPdpId).isDesignated());
- try {
- droolsPdpIntegrityMonitor.startTransaction();
- droolsPdpIntegrityMonitor.endTransaction();
- PolicyLogger.debug("testLocking1: As expected, transaction successful");
- } catch (AdministrativeStateException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
- assertTrue(false);
- } catch (StandbyStatusException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
- assertTrue(false);
- } catch (Exception e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
- assertTrue(false);
- }
-
- PolicyLogger.debug("testLocking1: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
-
- PolicyLogger.debug("\n\ntestLocking1: Exiting\n\n");
- Thread.sleep(interruptRecoveryTime);
-
- }
-
- /*
- * 1) Inserts and designates this PDP, then verifies that startTransaction
- * is successful.
- *
- * 2) Inserts another PDP in hotstandby.
- *
- * 3) Demotes this PDP, and verifies 1) that other PDP is not promoted (because one
- * PDP cannot promote another PDP) and 2) that this PDP is re-promoted.
- */
- @Ignore
- @Test
- public void testLocking2() throws Exception {
-
- PolicyLogger.debug("\n\ntestLocking2: Entering\n\n");
-
- PolicyLogger.debug("testLocking2: Reading IntegrityMonitorProperties");
- Properties integrityMonitorProperties = new Properties();
- integrityMonitorProperties.load(new FileInputStream(new File(
- "src/test/server/config/IntegrityMonitor.properties")));
- IntegrityMonitorProperties.initProperties(integrityMonitorProperties);
- String thisPdpId = IntegrityMonitorProperties
- .getProperty(IntegrityMonitorProperties.PDP_INSTANCE_ID);
-
- PolicyLogger.debug("testLocking2: Reading xacmlPersistenceProperties");
- Properties xacmlPersistenceProperties = new Properties();
- xacmlPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/xacmlPersistence.properties")));
- XacmlPersistenceProperties.initProperties(xacmlPersistenceProperties);
-
- PolicyLogger.debug("testLocking2: Creating emfXacml");
- EntityManagerFactory emfXacml = Persistence.createEntityManagerFactory(
- "junitXacmlPU", xacmlPersistenceProperties);
-
- PolicyLogger.debug("testLocking2: Reading droolsPersistenceProperties");
- Properties droolsPersistenceProperties = new Properties();
- droolsPersistenceProperties.load(new FileInputStream(new File(
- "src/test/server/config/droolsPersistence.properties")));
- DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
-
- PolicyLogger.debug("testLocking2: Creating emfDrools");
- EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
- "junitDroolsPU", droolsPersistenceProperties);
-
- DroolsPdpsConnector conn = new JpaDroolsPdpsConnector(emfDrools);
-
- PolicyLogger.debug("testLocking2: Cleaning up tables");
- conn.deleteAllSessions();
- conn.deleteAllPdps();
-
- /*
- * Insert this PDP as designated. Initial standby state will be
- * either null or cold standby. Demoting should transit state to
- * hot standby.
- */
- PolicyLogger.debug("testLocking2: Inserting PDP=" + thisPdpId + " as designated");
- DroolsPdpImpl pdp = new DroolsPdpImpl(thisPdpId, true, 3, new Date());
- conn.insertPdp(pdp);
- DroolsPdpEntity droolsPdpEntity = conn.getPdp(thisPdpId);
- PolicyLogger.debug("testLocking2: After insertion, PDP=" + thisPdpId + " has DESIGNATED="
- + droolsPdpEntity.isDesignated());
- assertTrue(droolsPdpEntity.isDesignated() == true);
-
- PolicyLogger.debug("testLocking2: Instantiating stateManagement object and promoting PDP=" + thisPdpId);
- StateManagement sm = new StateManagement(emfXacml, "dummy");
- sm.deleteAllStateManagementEntities();
- sm = new StateManagement(emfXacml, thisPdpId);
- PMStandbyStateChangeNotifier pmStandbyStateChangeNotifier = new PMStandbyStateChangeNotifier();
- sm.addObserver(pmStandbyStateChangeNotifier);
-
- /*
- * Insert another PDP as not designated. Initial standby state will be
- * either null or cold standby. Demoting should transit state to
- * hot standby.
- */
- String standbyPdpId = "pdp2";
- PolicyLogger.debug("testLocking2: Inserting PDP=" + standbyPdpId + " as not designated");
- Date yesterday = DateUtils.addDays(new Date(), -1);
- pdp = new DroolsPdpImpl(standbyPdpId, false, 4, yesterday);
- conn.insertPdp(pdp);
- droolsPdpEntity = conn.getPdp(standbyPdpId);
- PolicyLogger.debug("testLocking2: After insertion, PDP=" + standbyPdpId + " has DESIGNATED="
- + droolsPdpEntity.isDesignated());
- assertTrue(droolsPdpEntity.isDesignated() == false);
-
- PolicyLogger.debug("testLocking2: Demoting PDP=" + standbyPdpId);
- StateManagement sm2 = new StateManagement(emfXacml, standbyPdpId);
- sm2.addObserver(pmStandbyStateChangeNotifier);
-
- PolicyLogger.debug("testLocking2: Running policy-management.Main class");
- PolicyManagementRunner policyManagementRunner = new PolicyManagementRunner();
- policyManagementRunner.start();
-
- PolicyLogger.debug("testLocking2: Runner started; Sleeping "
- + interruptRecoveryTime + "ms before promoting/demoting");
- Thread.sleep(interruptRecoveryTime);
-
- PolicyLogger.debug("testLocking2: Promoting PDP=" + thisPdpId);
- sm.promote();
-
- // demoting PDP should ensure that state transits to hotstandby
- PolicyLogger.debug("testLocking2: Demoting PDP=" + standbyPdpId);
- sm2.demote();
-
- PolicyLogger.debug("testLocking2: Sleeping "
- + sleepTime
- + "ms, to allow time for policy-management.Main class to come up");
- Thread.sleep(sleepTime);
-
- PolicyLogger.debug("testLocking2: Waking up and invoking startTransaction on active PDP="
- + thisPdpId
- + ", designated="
- + conn.getPdp(thisPdpId).isDesignated());
- DroolsPDPIntegrityMonitor droolsPdpIntegrityMonitor = (DroolsPDPIntegrityMonitor) IntegrityMonitor
- .getInstance();
- try {
- droolsPdpIntegrityMonitor.startTransaction();
- droolsPdpIntegrityMonitor.endTransaction();
- PolicyLogger.debug("testLocking2: As expected, transaction successful");
- } catch (AdministrativeStateException e) {
- PolicyLogger.error("testLocking2: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
- assertTrue(false);
- } catch (StandbyStatusException e) {
- PolicyLogger.error("testLocking2: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
- assertTrue(false);
- } catch (Exception e) {
- PolicyLogger.error("testLocking2: Unexpectedly caught Exception, message=" + e.getMessage());
- assertTrue(false);
- }
-
- // demoting should cause state to transit to hotstandby followed by re-promotion.
- PolicyLogger.debug("testLocking2: demoting PDP=" + thisPdpId);
- sm = droolsPdpIntegrityMonitor.getStateManager();
- sm.demote();
-
- PolicyLogger.debug("testLocking2: sleeping" + electionWaitSleepTime
- + " to allow election handler to re-promote PDP=" + thisPdpId);
- Thread.sleep(electionWaitSleepTime);
-
- PolicyLogger.debug("testLocking2: Waking up and invoking startTransaction on re-promoted PDP="
- + thisPdpId + ", designated="
- + conn.getPdp(thisPdpId).isDesignated());
- try {
- droolsPdpIntegrityMonitor.startTransaction();
- droolsPdpIntegrityMonitor.endTransaction();
- PolicyLogger.debug("testLocking2: As expected, transaction successful");
- } catch (AdministrativeStateException e) {
- PolicyLogger.error("testLocking2: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
- assertTrue(false);
- } catch (StandbyStatusException e) {
- PolicyLogger.error("testLocking2: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
- assertTrue(false);
- } catch (Exception e) {
- PolicyLogger.error("testLocking2: Unexpectedly caught Exception, message=" + e.getMessage());
- assertTrue(false);
- }
-
- PolicyLogger.debug("testLocking2: Verifying designated status for PDP="
- + standbyPdpId);
- boolean standbyPdpDesignated = conn.getPdp(standbyPdpId).isDesignated();
- assertTrue(standbyPdpDesignated == false);
-
- PolicyLogger.debug("testLocking2: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
-
- PolicyLogger.debug("\n\ntestLocking2: Exiting\n\n");
- Thread.sleep(interruptRecoveryTime);
-
- }
-
- private class PolicyManagementRunner extends Thread {
-
- public void run() {
- PolicyLogger.debug("PolicyManagementRunner.run: Entering");
- String args[] = { "src/main/server/config" };
- try {
- Main.main(args);
- } catch (Exception e) {
- PolicyLogger
- .debug("PolicyManagementRunner.run: Exception thrown from Main.main(), message="
- + e.getMessage());
- }
- PolicyLogger.debug("PolicyManagementRunner.run: Exiting");
- }
-
- public void stopRunner() {
- PolicyEngine.manager.shutdown();
- }
-
- }
-
-}
diff --git a/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java
index af649866..7e1d396f 100644
--- a/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java
+++ b/policy-persistence/src/test/java/org/openecomp/policy/drools/controller/test/StandbyStateManagementTest.java
@@ -24,10 +24,16 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Date;
import java.util.Properties;
+import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.junit.After;
@@ -36,7 +42,6 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
-
import org.openecomp.policy.common.logging.eelf.PolicyLogger;
import org.openecomp.policy.common.im.AdministrativeStateException;
import org.openecomp.policy.common.im.IntegrityMonitor;
@@ -50,17 +55,24 @@ import org.openecomp.policy.drools.persistence.DroolsPdp;
import org.openecomp.policy.drools.persistence.DroolsPdpEntity;
import org.openecomp.policy.drools.persistence.DroolsPdpImpl;
import org.openecomp.policy.drools.persistence.DroolsPdpsConnector;
+import org.openecomp.policy.drools.persistence.DroolsPdpsElectionHandler;
import org.openecomp.policy.drools.persistence.JpaDroolsPdpsConnector;
import org.openecomp.policy.drools.persistence.DroolsPersistenceProperties;
import org.openecomp.policy.drools.persistence.XacmlPersistenceProperties;
import org.openecomp.policy.drools.system.Main;
import org.openecomp.policy.drools.system.PolicyEngine;
-
import org.apache.commons.lang3.time.DateUtils;
/*
- * Cloned from StandbyStateManagement.java in support of US673632.
- * See MultiSite_v1-10.ppt, slide 38
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ *
+ * These tests can be run as JUnits, but there is some issue with running them
+ * as part of a "mvn install" build. Also, they take a very long time to run
+ * due to many real time breaks. Consequently, they are marked as @Ignore and
+ * only run from the desktop.
+ *
*/
public class StandbyStateManagementTest {
@@ -82,6 +94,12 @@ public class StandbyStateManagementTest {
* Sleep 5 seconds after each test to allow interrupt (shutdown) recovery.
*/
long interruptRecoveryTime = 5000;
+
+ private static EntityManagerFactory emfx;
+ private static EntityManagerFactory emfd;
+ private static EntityManager emx;
+ private static EntityManager emd;
+ private static EntityTransaction et;
/*
* See the IntegrityMonitor.getJmxUrl() method for the rationale behind this jmx related processing.
@@ -106,18 +124,423 @@ public class StandbyStateManagementTest {
@Before
public void setUp() throws Exception {
+ //Create teh data access for xaml db
+ Properties xacmlPersistenceProperties = new Properties();
+ xacmlPersistenceProperties.load(new FileInputStream(new File(
+ "src/test/server/config/xacmlPersistence.properties")));
+
+ emfx = Persistence.createEntityManagerFactory("junitXacmlPU", xacmlPersistenceProperties);
+
+ // Create an entity manager to use the DB
+ emx = emfx.createEntityManager();
+
+ //Create the data access for drools db
+ Properties droolsPersistenceProperties = new Properties();
+ droolsPersistenceProperties.load(new FileInputStream(new File(
+ "src/test/server/config/droolsPersistence.properties")));
+
+ emfd = Persistence.createEntityManagerFactory("junitDroolsPU", droolsPersistenceProperties);
+
+ // Create an entity manager to use the DB
+ emd = emfd.createEntityManager();
}
@After
public void tearDown() throws Exception {
}
-
+
+ public void cleanXacmlDb(){
+ et = emx.getTransaction();
+
+ et.begin();
+ // Make sure we leave the DB clean
+ emx.createQuery("DELETE FROM StateManagementEntity").executeUpdate();
+ emx.createQuery("DELETE FROM ResourceRegistrationEntity").executeUpdate();
+ emx.createQuery("DELETE FROM ForwardProgressEntity").executeUpdate();
+ emx.createQuery("DELETE FROM IntegrityAuditEntity").executeUpdate();
+ emx.flush();
+ et.commit();
+ }
+
+ public void cleanDroolsDb(){
+ et = emd.getTransaction();
+
+ et.begin();
+ // Make sure we leave the DB clean
+ emd.createQuery("DELETE FROM DroolsPdpEntity").executeUpdate();
+ emd.createQuery("DELETE FROM DroolsSessionEntity").executeUpdate();
+ emd.createQuery("DELETE FROM SessionInfo").executeUpdate();
+ emd.createQuery("DELETE FROM WorkItemInfo").executeUpdate();
+ emd.createQuery("DELETE FROM IntegrityAuditEntity").executeUpdate();
+ emd.flush();
+ et.commit();
+ }
+
@Ignore
@Test
+ public void runAllTests() throws Exception {
+ //testColdStandby();
+ //testHotStandby1();
+ //testHotStandby2();
+ //testLocking1();
+ //testLocking2();
+ testSanitizeDesignatedList();
+ testComputeMostRecentPrimary();
+ testComputeDesignatedPdp();
+ }
+
+ //@Ignore
+ //@Test
+ public void testSanitizeDesignatedList() throws Exception {
+
+ PolicyLogger.debug("\n\ntestSanitizeDesignatedList: Entering\n\n");
+
+ /*
+ * Get a DroolsPdpsConnector
+ */
+ PolicyLogger.debug("testSanitizeDesignatedList: Reading droolsPersistenceProperties");
+ Properties droolsPersistenceProperties = new Properties();
+ droolsPersistenceProperties.load(new FileInputStream(new File(
+ "src/test/server/config/droolsPersistence.properties")));
+ DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+ PolicyLogger.debug("testSanitizeDesignatedList: Creating emfDrools");
+ EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+ "junitDroolsPU", droolsPersistenceProperties);
+
+ DroolsPdpsConnector droolsPdpsConnector = new JpaDroolsPdpsConnector(emfDrools);
+
+ /*
+ * Create 4 pdpd all not designated
+ */
+ DroolsPdp pdp1 = new DroolsPdpImpl("pdp1", false, 4, new Date());
+ DroolsPdp pdp2 = new DroolsPdpImpl("pdp2", false, 4, new Date());
+ DroolsPdp pdp3 = new DroolsPdpImpl("pdp3", false, 4, new Date());
+ DroolsPdp pdp4 = new DroolsPdpImpl("pdp4", false, 4, new Date());
+
+ ArrayList<DroolsPdp> listOfDesignated = new ArrayList<DroolsPdp>();
+ listOfDesignated.add(pdp1);
+ listOfDesignated.add(pdp2);
+ listOfDesignated.add(pdp3);
+ listOfDesignated.add(pdp4);
+
+ DroolsPDPIntegrityMonitor droolsPDPIntegrityMonitor;
+ try{
+ droolsPDPIntegrityMonitor = DroolsPDPIntegrityMonitor.init("src/test/server/config");
+ }catch(Exception e){
+ //If it already exists, just get it
+ droolsPDPIntegrityMonitor = DroolsPDPIntegrityMonitor.getInstance();
+ }
+ DroolsPdpsElectionHandler droolsPdpsElectionHandler = new DroolsPdpsElectionHandler(droolsPdpsConnector, pdp1, droolsPDPIntegrityMonitor);
+
+ listOfDesignated = droolsPdpsElectionHandler.santizeDesignatedList(listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestSanitizeDesignatedList: listOfDesignated.size = " + listOfDesignated.size() + "\n\n");
+
+ assertTrue(listOfDesignated.size()==4);
+
+ /*
+ * Now make 2 designated
+ */
+ pdp1.setDesignated(true);
+ pdp2.setDesignated(true);
+
+ listOfDesignated = droolsPdpsElectionHandler.santizeDesignatedList(listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestSanitizeDesignatedList: listOfDesignated.size after 2 designated = " + listOfDesignated.size() + "\n\n");
+
+ assertTrue(listOfDesignated.size()==2);
+ assertTrue(listOfDesignated.contains(pdp1));
+ assertTrue(listOfDesignated.contains(pdp2));
+
+ /*
+ * Now all are designated. But, we have to add back the previously non-designated nodes
+ */
+ pdp3.setDesignated(true);
+ pdp4.setDesignated(true);
+ listOfDesignated.add(pdp3);
+ listOfDesignated.add(pdp4);
+
+ listOfDesignated = droolsPdpsElectionHandler.santizeDesignatedList(listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestSanitizeDesignatedList: listOfDesignated.size after all designated = " + listOfDesignated.size() + "\n\n");
+
+ assertTrue(listOfDesignated.size()==4);
+
+ }
+
+ //@Ignore
+ //@Test
+ public void testComputeMostRecentPrimary() throws Exception {
+
+ PolicyLogger.debug("\n\ntestComputeMostRecentPrimary: Entering\n\n");
+
+ /*
+ * Get a DroolsPdpsConnector
+ */
+ PolicyLogger.debug("testComputeMostRecentPrimary: Reading droolsPersistenceProperties");
+ Properties droolsPersistenceProperties = new Properties();
+ droolsPersistenceProperties.load(new FileInputStream(new File(
+ "src/test/server/config/droolsPersistence.properties")));
+ DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+ PolicyLogger.debug("testComputeMostRecentPrimary: Creating emfDrools");
+ EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+ "junitDroolsPU", droolsPersistenceProperties);
+
+ DroolsPdpsConnector droolsPdpsConnector = new JpaDroolsPdpsConnector(emfDrools);
+
+ /*
+ * Create 4 pdpd all not designated
+ */
+ long designatedDateMS = new Date().getTime();
+ DroolsPdp pdp1 = new DroolsPdpImpl("pdp1", false, 4, new Date());
+ pdp1.setDesignatedDate(new Date(designatedDateMS - 2));
+
+ DroolsPdp pdp2 = new DroolsPdpImpl("pdp2", false, 4, new Date());
+ //oldest
+ pdp2.setDesignatedDate(new Date(designatedDateMS - 3));
+
+ DroolsPdp pdp3 = new DroolsPdpImpl("pdp3", false, 4, new Date());
+ pdp3.setDesignatedDate(new Date(designatedDateMS - 1));
+
+ DroolsPdp pdp4 = new DroolsPdpImpl("pdp4", false, 4, new Date());
+ //most recent
+ pdp4.setDesignatedDate(new Date(designatedDateMS));
+
+ ArrayList<DroolsPdp> listOfAllPdps = new ArrayList<DroolsPdp>();
+ listOfAllPdps.add(pdp1);
+ listOfAllPdps.add(pdp2);
+ listOfAllPdps.add(pdp3);
+ listOfAllPdps.add(pdp4);
+
+
+ ArrayList<DroolsPdp> listOfDesignated = new ArrayList<DroolsPdp>();
+ listOfDesignated.add(pdp1);
+ listOfDesignated.add(pdp2);
+ listOfDesignated.add(pdp3);
+ listOfDesignated.add(pdp4);
+
+
+ /*
+ * Because the way we sanitize the listOfDesignated, it will always contain all hot standby
+ * or all designated members.
+ */
+ DroolsPDPIntegrityMonitor droolsPDPIntegrityMonitor;
+ try{
+ droolsPDPIntegrityMonitor = DroolsPDPIntegrityMonitor.init("src/test/server/config");
+ }catch(Exception e){
+ //If it already exists, just get it
+ droolsPDPIntegrityMonitor = DroolsPDPIntegrityMonitor.getInstance();
+ }
+ DroolsPdpsElectionHandler droolsPdpsElectionHandler = new DroolsPdpsElectionHandler(droolsPdpsConnector, pdp1, droolsPDPIntegrityMonitor);
+
+ DroolsPdp mostRecentPrimary = droolsPdpsElectionHandler.computeMostRecentPrimary(listOfAllPdps, listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestComputeMostRecentPrimary: mostRecentPrimary.getPdpId() = " + mostRecentPrimary.getPdpId() + "\n\n");
+
+ /*
+ * If all of the pdps are included in the listOfDesignated and none are designated, it will choose
+ * the one which has the most recent designated date.
+ */
+ assertTrue(mostRecentPrimary.getPdpId().equals("pdp4"));
+
+ /*
+ * Now let's designate all of those on the listOfDesignated. It will choose the first one designated
+ */
+ pdp1.setDesignated(true);
+ pdp2.setDesignated(true);
+ pdp3.setDesignated(true);
+ pdp4.setDesignated(true);
+
+ mostRecentPrimary = droolsPdpsElectionHandler.computeMostRecentPrimary(listOfAllPdps, listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestComputeMostRecentPrimary: All designated all on list, mostRecentPrimary.getPdpId() = " + mostRecentPrimary.getPdpId() + "\n\n");
+
+ /*
+ * If all of the pdps are included in the listOfDesignated and all are designated, it will choose
+ * the one which was designated first
+ */
+ assertTrue(mostRecentPrimary.getPdpId().equals("pdp2"));
+
+ /*
+ * Now we will designate only 2 and put just them in the listOfDesignated. The algorithm will now
+ * look for the most recently designated pdp which is not currently designated.
+ */
+ pdp3.setDesignated(false);
+ pdp4.setDesignated(false);
+
+ listOfDesignated.remove(pdp3);
+ listOfDesignated.remove(pdp4);
+
+ mostRecentPrimary = droolsPdpsElectionHandler.computeMostRecentPrimary(listOfAllPdps, listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestComputeMostRecentPrimary: mostRecentPrimary.getPdpId() = " + mostRecentPrimary.getPdpId() + "\n\n");
+
+ assertTrue(mostRecentPrimary.getPdpId().equals("pdp4"));
+
+
+ /*
+ * Now we will have none designated and put two of them in the listOfDesignated. The algorithm will now
+ * look for the most recently designated pdp regardless of whether it is currently marked as designated.
+ */
+ pdp1.setDesignated(false);
+ pdp2.setDesignated(false);
+
+ mostRecentPrimary = droolsPdpsElectionHandler.computeMostRecentPrimary(listOfAllPdps, listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestComputeMostRecentPrimary: 2 on list mostRecentPrimary.getPdpId() = " + mostRecentPrimary.getPdpId() + "\n\n");
+
+ assertTrue(mostRecentPrimary.getPdpId().equals("pdp4"));
+
+ /*
+ * If we have only one pdp on in the listOfDesignated, the most recently designated pdp will be chosen, regardless
+ * of its designation status
+ */
+ listOfDesignated.remove(pdp1);
+
+ mostRecentPrimary = droolsPdpsElectionHandler.computeMostRecentPrimary(listOfAllPdps, listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestComputeMostRecentPrimary: 1 on list mostRecentPrimary.getPdpId() = " + mostRecentPrimary.getPdpId() + "\n\n");
+
+ assertTrue(mostRecentPrimary.getPdpId().equals("pdp4"));
+
+ /*
+ * Finally, if none are on the listOfDesignated, it will again choose the most recently designated pdp.
+ */
+ listOfDesignated.remove(pdp2);
+
+ mostRecentPrimary = droolsPdpsElectionHandler.computeMostRecentPrimary(listOfAllPdps, listOfDesignated);
+
+ PolicyLogger.debug("\n\ntestComputeMostRecentPrimary: 0 on list mostRecentPrimary.getPdpId() = " + mostRecentPrimary.getPdpId() + "\n\n");
+
+ assertTrue(mostRecentPrimary.getPdpId().equals("pdp4"));
+
+ }
+
+ //@Ignore
+ //@Test
+ public void testComputeDesignatedPdp() throws Exception{
+
+ PolicyLogger.debug("\n\ntestComputeDesignatedPdp: Entering\n\n");
+
+ /*
+ * Get a DroolsPdpsConnector
+ */
+ PolicyLogger.debug("testComputeDesignatedPdp: Reading droolsPersistenceProperties");
+ Properties droolsPersistenceProperties = new Properties();
+ droolsPersistenceProperties.load(new FileInputStream(new File(
+ "src/test/server/config/droolsPersistence.properties")));
+ DroolsPersistenceProperties.initProperties(droolsPersistenceProperties);
+
+ PolicyLogger.debug("testComputeDesignatedPdp: Creating emfDrools");
+ EntityManagerFactory emfDrools = Persistence.createEntityManagerFactory(
+ "junitDroolsPU", droolsPersistenceProperties);
+
+ DroolsPdpsConnector droolsPdpsConnector = new JpaDroolsPdpsConnector(emfDrools);
+
+ /*
+ * Create 4 pdpd all not designated. Two on site1. Two on site2
+ */
+ long designatedDateMS = new Date().getTime();
+ DroolsPdp pdp1 = new DroolsPdpImpl("pdp1", false, 4, new Date());
+ pdp1.setDesignatedDate(new Date(designatedDateMS - 2));
+ pdp1.setSiteName("site1");
+
+ DroolsPdp pdp2 = new DroolsPdpImpl("pdp2", false, 4, new Date());
+ pdp2.setDesignatedDate(new Date(designatedDateMS - 3));
+ pdp2.setSiteName("site1");
+
+ //oldest
+ DroolsPdp pdp3 = new DroolsPdpImpl("pdp3", false, 4, new Date());
+ pdp3.setDesignatedDate(new Date(designatedDateMS - 4));
+ pdp3.setSiteName("site2");
+
+ DroolsPdp pdp4 = new DroolsPdpImpl("pdp4", false, 4, new Date());
+ //most recent
+ pdp4.setDesignatedDate(new Date(designatedDateMS));
+ pdp4.setSiteName("site2");
+
+ ArrayList<DroolsPdp> listOfAllPdps = new ArrayList<DroolsPdp>();
+ listOfAllPdps.add(pdp1);
+ listOfAllPdps.add(pdp2);
+ listOfAllPdps.add(pdp3);
+ listOfAllPdps.add(pdp4);
+
+
+ ArrayList<DroolsPdp> listOfDesignated = new ArrayList<DroolsPdp>();
+
+ /*
+ * We will first test an empty listOfDesignated. As we know from the previous JUnit,
+ * the pdp with the most designated date will be chosen for mostRecentPrimary
+ */
+
+ DroolsPDPIntegrityMonitor droolsPDPIntegrityMonitor;
+ try{
+ droolsPDPIntegrityMonitor = DroolsPDPIntegrityMonitor.init("src/test/server/config");
+ }catch(Exception e){
+ //If it already exists, just get it
+ droolsPDPIntegrityMonitor = DroolsPDPIntegrityMonitor.getInstance();
+ }
+ DroolsPdpsElectionHandler droolsPdpsElectionHandler = new DroolsPdpsElectionHandler(droolsPdpsConnector, pdp1, droolsPDPIntegrityMonitor);
+
+ DroolsPdp mostRecentPrimary = pdp4;
+
+ DroolsPdp designatedPdp = droolsPdpsElectionHandler.computeDesignatedPdp(listOfDesignated, mostRecentPrimary);
+
+ /*
+ * The designatedPdp should be null
+ */
+ assertTrue(designatedPdp==null);
+
+ /*
+ * Now let's try having only one pdp in listOfDesignated, but not in the same site as the most recent primary
+ */
+
+ listOfDesignated.add(pdp2);
+
+ designatedPdp = droolsPdpsElectionHandler.computeDesignatedPdp(listOfDesignated, mostRecentPrimary);
+
+ /*
+ * Now the designatedPdp should be the one and only selection in the listOfDesignated
+ */
+ assertTrue(designatedPdp.getPdpId().equals(pdp2.getPdpId()));
+
+ /*
+ * Now let's put 2 pdps in the listOfDesignated, neither in the same site as the mostRecentPrimary
+ */
+ listOfDesignated.add(pdp1);
+
+ designatedPdp = droolsPdpsElectionHandler.computeDesignatedPdp(listOfDesignated, mostRecentPrimary);
+
+ /*
+ * The designatedPdp should now be the one with the lowest lexiographic score - pdp1
+ */
+ assertTrue(designatedPdp.getPdpId().equals(pdp1.getPdpId()));
+
+ /*
+ * Finally, we will have 2 pdps in the listOfDesignated, one in the same site with the mostRecentPrimary
+ */
+ listOfDesignated.remove(pdp1);
+ listOfDesignated.add(pdp3);
+
+ designatedPdp = droolsPdpsElectionHandler.computeDesignatedPdp(listOfDesignated, mostRecentPrimary);
+
+ /*
+ * The designatedPdp should now be the one on the same site as the mostRecentPrimary
+ */
+ assertTrue(designatedPdp.getPdpId().equals(pdp3.getPdpId()));
+ }
+
+
+ //@Ignore
+ //@Test
public void testColdStandby() throws Exception {
PolicyLogger.debug("\n\ntestColdStandby: Entering\n\n");
+ cleanXacmlDb();
+ cleanDroolsDb();
PolicyLogger.debug("testColdStandby: Reading IntegrityMonitorProperties");
Properties integrityMonitorProperties = new Properties();
@@ -213,7 +636,7 @@ public class StandbyStateManagementTest {
assertTrue(droolsPdpEntity.isDesignated() == false);
PolicyLogger.debug("testColdStandby: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
+ //policyManagementRunner.stopRunner();
PolicyLogger.debug("\n\ntestColdStandby: Exiting\n\n");
Thread.sleep(interruptRecoveryTime);
@@ -223,11 +646,13 @@ public class StandbyStateManagementTest {
/*
* Tests hot standby when there is only one PDP.
*/
- @Ignore
- @Test
+ //@Ignore
+ //@Test
public void testHotStandby1() throws Exception {
PolicyLogger.debug("\n\ntestHotStandby1: Entering\n\n");
+ cleanXacmlDb();
+ cleanDroolsDb();
PolicyLogger.debug("testHotStandby1: Reading IntegrityMonitorProperties");
Properties integrityMonitorProperties = new Properties();
@@ -310,7 +735,7 @@ public class StandbyStateManagementTest {
assertTrue(standbyStatus != null && standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
PolicyLogger.debug("testHotStandby1: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
+ //policyManagementRunner.stopRunner();
PolicyLogger.debug("\n\ntestHotStandby1: Exiting\n\n");
Thread.sleep(interruptRecoveryTime);
@@ -320,11 +745,13 @@ public class StandbyStateManagementTest {
/*
* Tests hot standby when two PDPs are involved.
*/
- @Ignore
- @Test
+ //@Ignore
+ //@Test
public void testHotStandby2() throws Exception {
PolicyLogger.info("\n\ntestHotStandby2: Entering\n\n");
+ cleanXacmlDb();
+ cleanDroolsDb();
PolicyLogger.info("testHotStandby2: Reading IntegrityMonitorProperties");
Properties integrityMonitorProperties = new Properties();
@@ -453,7 +880,7 @@ public class StandbyStateManagementTest {
&& standbyStatus.equals(StateManagement.PROVIDING_SERVICE));
PolicyLogger.info("testHotStandby2: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
+ //policyManagementRunner.stopRunner();
PolicyLogger.info("\n\ntestHotStandby2: Exiting\n\n");
Thread.sleep(interruptRecoveryTime);
@@ -477,10 +904,13 @@ public class StandbyStateManagementTest {
* 5) Promotes PDP and verifies that startTransaction is once again
* successful.
*/
- @Ignore
- @Test
+ //@Ignore
+ //@Test
public void testLocking1() throws Exception {
-
+ PolicyLogger.debug("testLocking1: Entry");
+ cleanXacmlDb();
+ cleanDroolsDb();
+
PolicyLogger.debug("testLocking1: Reading IntegrityMonitorProperties");
Properties integrityMonitorProperties = new Properties();
integrityMonitorProperties.load(new FileInputStream(new File(
@@ -631,13 +1061,13 @@ public class StandbyStateManagementTest {
droolsPdpIntegrityMonitor.endTransaction();
}
- // unlocking should cause state to transit to hot standby
+ // unlocking should cause state to transit to hot standby and then providing service
PolicyLogger.debug("testLocking1: unlocking PDP=" + thisPdpId);
sm.unlock();
// Just to avoid any race conditions, sleep a little after locking
PolicyLogger.debug("testLocking1: Sleeping a few millis after unlocking, to avoid race condition");
- Thread.sleep(100);
+ Thread.sleep(electionWaitSleepTime);
PolicyLogger.debug("testLocking1: Invoking startTransaction on unlocked PDP="
+ thisPdpId
@@ -645,13 +1075,13 @@ public class StandbyStateManagementTest {
+ conn.getPdp(thisPdpId).isDesignated());
try {
droolsPdpIntegrityMonitor.startTransaction();
- PolicyLogger.error("testLocking1: startTransaction unexpectedly successful");
- assertTrue(false);
+ PolicyLogger.error("testLocking1: startTransaction successful as expected");
} catch (AdministrativeStateException e) {
PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
assertTrue(false);
} catch (StandbyStatusException e) {
- PolicyLogger.debug("testLocking1: As expected, caught StandbyStatusException, message=" + e.getMessage());
+ PolicyLogger.debug("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
+ assertTrue(false);
} catch (Exception e) {
PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
assertTrue(false);
@@ -659,35 +1089,35 @@ public class StandbyStateManagementTest {
droolsPdpIntegrityMonitor.endTransaction();
}
- // promoting should cause state to transit to providing service
- PolicyLogger.debug("testLocking1: promoting PDP=" + thisPdpId);
- sm.promote();
+ // demoting should cause state to transit to providing service
+ PolicyLogger.debug("testLocking1: demoting PDP=" + thisPdpId);
+ sm.demote();
// Just to avoid any race conditions, sleep a little after promoting
- PolicyLogger.debug("testLocking1: Sleeping a few millis after promoting, to avoid race condition");
+ PolicyLogger.debug("testLocking1: Sleeping a few millis after demoting, to avoid race condition");
Thread.sleep(100);
- PolicyLogger.debug("testLocking1: Invoking startTransaction on promoted PDP="
+ PolicyLogger.debug("testLocking1: Invoking startTransaction on demoted PDP="
+ thisPdpId
+ ", designated="
+ conn.getPdp(thisPdpId).isDesignated());
try {
droolsPdpIntegrityMonitor.startTransaction();
droolsPdpIntegrityMonitor.endTransaction();
- PolicyLogger.debug("testLocking1: As expected, transaction successful");
+ PolicyLogger.debug("testLocking1: Unexpectedly, transaction successful");
+ assertTrue(false);
} catch (AdministrativeStateException e) {
PolicyLogger.error("testLocking1: Unexpectedly caught AdministrativeStateException, message=" + e.getMessage());
assertTrue(false);
} catch (StandbyStatusException e) {
- PolicyLogger.error("testLocking1: Unexpectedly caught StandbyStatusException, message=" + e.getMessage());
- assertTrue(false);
+ PolicyLogger.error("testLocking1: As expected caught StandbyStatusException, message=" + e.getMessage());
} catch (Exception e) {
PolicyLogger.error("testLocking1: Unexpectedly caught Exception, message=" + e.getMessage());
assertTrue(false);
}
PolicyLogger.debug("testLocking1: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
+ //policyManagementRunner.stopRunner();
PolicyLogger.debug("\n\ntestLocking1: Exiting\n\n");
Thread.sleep(interruptRecoveryTime);
@@ -703,11 +1133,13 @@ public class StandbyStateManagementTest {
* 3) Demotes this PDP, and verifies 1) that other PDP is not promoted (because one
* PDP cannot promote another PDP) and 2) that this PDP is re-promoted.
*/
- @Ignore
- @Test
+ //@Ignore
+ //@Test
public void testLocking2() throws Exception {
PolicyLogger.debug("\n\ntestLocking2: Entering\n\n");
+ cleanXacmlDb();
+ cleanDroolsDb();
PolicyLogger.debug("testLocking2: Reading IntegrityMonitorProperties");
Properties integrityMonitorProperties = new Properties();
@@ -856,7 +1288,7 @@ public class StandbyStateManagementTest {
assertTrue(standbyPdpDesignated == false);
PolicyLogger.debug("testLocking2: Stopping policyManagementRunner");
- policyManagementRunner.stopRunner();
+ //policyManagementRunner.stopRunner();
PolicyLogger.debug("\n\ntestLocking2: Exiting\n\n");
Thread.sleep(interruptRecoveryTime);
@@ -874,6 +1306,7 @@ public class StandbyStateManagementTest {
PolicyLogger
.info("PolicyManagementRunner.run: Exception thrown from Main.main(), message="
+ e.getMessage());
+ return;
}
PolicyLogger.info("PolicyManagementRunner.run: Exiting");
}
diff --git a/policy-persistence/src/test/resources/IntegrityMonitor.properties b/policy-persistence/src/test/resources/IntegrityMonitor.properties
index 0ab36286..4e182e02 100644
--- a/policy-persistence/src/test/resources/IntegrityMonitor.properties
+++ b/policy-persistence/src/test/resources/IntegrityMonitor.properties
@@ -60,8 +60,12 @@ pdp.initialWait=20000
resource.name=pdp1
#resource.name=${{resource_name}}
+# Flag to control the execution of the subsystemTest for the Database
+db.audit.is.active=false
-
+# Flag to control the execution of the subsystemTest for the Nexus Maven repository
+repository.audit.is.active=false
+repository.audit.ignore.errors=true
diff --git a/policy-persistence/src/test/resources/META-INF/persistence.xml b/policy-persistence/src/test/resources/META-INF/persistence.xml
index 51ec1613..ed8a8cd7 100644
--- a/policy-persistence/src/test/resources/META-INF/persistence.xml
+++ b/policy-persistence/src/test/resources/META-INF/persistence.xml
@@ -27,7 +27,7 @@
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>org.openecomp.policy.drools.persistence.DroolsPdpEntity</class>
<class>org.openecomp.policy.drools.persistence.DroolsSessionEntity</class>
- <class>org.openecomp.policy.drools.persistence.LastSiteEntity</class>
+ <!-- <class>org.openecomp.policy.drools.persistence.LastSiteEntity</class> -->
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity</class>
diff --git a/policy-persistence/src/test/server/config/IntegrityMonitor.properties b/policy-persistence/src/test/server/config/IntegrityMonitor.properties
index b16beda9..5e7085ca 100644
--- a/policy-persistence/src/test/server/config/IntegrityMonitor.properties
+++ b/policy-persistence/src/test/server/config/IntegrityMonitor.properties
@@ -60,3 +60,10 @@ resource.name=pdp1
# -1 turns off audit
# zero forces audit to run continuously
integrity_audit_period_seconds=60
+
+# Flag to control the execution of the subsystemTest for the Database
+db.audit.is.active=false
+
+# Flag to control the execution of the subsystemTest for the Nexus Maven repository
+repository.audit.is.active=false
+repository.audit.ignore.errors=true \ No newline at end of file
diff --git a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
index 2747e85e..809d3679 100644
--- a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
+++ b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
@@ -22,6 +22,7 @@ package org.openecomp.policy.drools.utils;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ServiceLoader;
@@ -80,7 +81,7 @@ public class OrderedServiceImpl<T extends OrderedService>
List<T> tmp = new LinkedList<T>();
for (T service : serviceLoader)
{
- tmp.add(service);
+ tmp.add((T)getSingleton(service));
}
// Sort the list according to sequence number, and then alphabetically
@@ -114,4 +115,34 @@ public class OrderedServiceImpl<T extends OrderedService>
System.out.println("***** OrderedServiceImpl implementers:\n" + implementers);
return(implementers);
}
+
+ // use this to ensure that we only use one unique instance of each class
+ static private HashMap<Class,OrderedService> classToSingleton =
+ new HashMap<>();
+
+ /**
+ * If a service implements multiple APIs managed by 'ServiceLoader', a
+ * separate instance is created for each API. This method ensures that
+ * the first instance is used in all of the lists.
+ *
+ * @param service this is the object created by ServiceLoader
+ * @return the object to use in place of 'service'. If 'service' is the first
+ * object of this class created by ServiceLoader, it is returned. If not,
+ * the object of this class that was initially created is returned
+ * instead.
+ */
+ static private synchronized OrderedService
+ getSingleton(OrderedService service)
+ {
+ // see if we already have an instance of this class
+ OrderedService rval = classToSingleton.get(service.getClass());
+ if (rval == null)
+ {
+ // No previous instance of this class exists -- use the supplied
+ // instance, and place it in the table.
+ rval = service;
+ classToSingleton.put(service.getClass(), service);
+ }
+ return(rval);
+ }
}
diff --git a/pom.xml b/pom.xml
index a09203fc..78e5cfcf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,10 +34,16 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
+ <swagger-maven-plugin-version>3.1.4</swagger-maven-plugin-version>
+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.source.version>1.8</project.source.version>
<project.target.version>1.8</project.target.version>
<common-modules.version>1.1.0-SNAPSHOT</common-modules.version>
+ <dmaap.version>0.2.12</dmaap.version>
+ <cambria.version>0.0.1</cambria.version>
+ <jersey.version>2.22.2</jersey.version>
+ <jackson.version>2.8.4</jackson.version>
<sonar.language>java</sonar.language>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
@@ -118,7 +124,61 @@
<dependencies>
</dependencies>
-
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>10.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.hk2.external</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>2.4.0-b31</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-base</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-yaml</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.datatype</groupId>
+ <artifactId>jackson-datatype-joda</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-common</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-servlet-core</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<build>
<plugins>
<plugin>
@@ -133,6 +193,53 @@
</configuration>
</plugin>
<plugin>
+ <groupId>com.github.kongchen</groupId>
+ <artifactId>swagger-maven-plugin</artifactId>
+ <version>${swagger-maven-plugin-version}</version>
+ <configuration>
+ <apiSources>
+ <apiSource>
+ <springmvc>false</springmvc>
+ <locations>
+ <location>
+ org.openecomp.policy.drools.core.DroolsPDPIntegrityMonitor
+ </location>
+ </locations>
+ <info>
+ <title>Drools PDP</title>
+ <version>1.0.0</version>
+ </info>
+ <swaggerDirectory>${project.build.directory}/swagger/integrityMonitor</swaggerDirectory>
+ <swaggerFileName>swagger</swaggerFileName>
+ <attachSwaggerArtifact>true</attachSwaggerArtifact>
+ </apiSource>
+ </apiSources>
+ </configuration>
+ <dependencies>
+ <!-- Adding dependency to swagger-hibernate-validations to enable the BeanValidator as a custom
+ model converter -->
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-hibernate-validations</artifactId>
+ <version>1.5.6</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.4</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8</version> <!-- This version supports the "deployAtEnd" parameter -->