diff options
Diffstat (limited to 'ONAP-PAP-REST')
12 files changed, 337 insertions, 249 deletions
diff --git a/ONAP-PAP-REST/pom.xml b/ONAP-PAP-REST/pom.xml index dc9499276..d2d84db3d 100644 --- a/ONAP-PAP-REST/pom.xml +++ b/ONAP-PAP-REST/pom.xml @@ -207,12 +207,11 @@ <artifactId>eclipselink</artifactId> <version>2.6.0</version> </dependency> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>5.1.30</version> - </dependency> + <groupId>org.mariadb.jdbc</groupId> + <artifactId>mariadb-java-client</artifactId> + <version>2.1.1</version> + </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-mock</artifactId> diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java index 7c46990ab..483418c59 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java @@ -2156,7 +2156,7 @@ public class PolicyDBDao { String prefix = null; if (policy.policyAdapter.getPolicyType().equalsIgnoreCase("Config")) { - prefix = configPath.substring(configPath.indexOf(policyScope+".")+policyScope.concat(".").length(), configPath.indexOf(policy.policyAdapter.getPolicyName())); + prefix = configPath.substring(configPath.indexOf(policyScope+".")+policyScope.concat(".").length(), configPath.lastIndexOf(policy.policyAdapter.getPolicyName())); if(isNullOrEmpty(policy.policyAdapter.getConfigBodyData())){ String configData = ""; try{ diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/daoimpl/CommonClassDaoImpl.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/daoimpl/CommonClassDaoImpl.java index e6514469c..5d2b7f6c7 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/daoimpl/CommonClassDaoImpl.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/daoimpl/CommonClassDaoImpl.java @@ -448,4 +448,8 @@ public class CommonClassDaoImpl implements CommonClassDao{ return null; } + public static void setSessionfactory(SessionFactory sessionfactory) { + sessionFactory = sessionfactory; + } + }
\ No newline at end of file diff --git a/ONAP-PAP-REST/src/main/resources/META-INF/generatedCreate.ddl b/ONAP-PAP-REST/src/main/resources/META-INF/generatedCreate.ddl deleted file mode 100644 index c12949aed..000000000 --- a/ONAP-PAP-REST/src/main/resources/META-INF/generatedCreate.ddl +++ /dev/null @@ -1,119 +0,0 @@ -CREATE TABLE 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, policyVersion INTEGER, scope VARCHAR(255) NOT NULL, version INTEGER, actionBodyId BIGINT, configurationDataId BIGINT, PRIMARY KEY (policyId)) -CREATE TABLE 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)) -CREATE TABLE PolicyDBDaoEntity (policyDBDaoUrl VARCHAR NOT NULL, created_date TIMESTAMP, description VARCHAR(2048) NOT NULL, modified_date TIMESTAMP NOT NULL, password VARCHAR, username VARCHAR, PRIMARY KEY (policyDBDaoUrl)) -CREATE TABLE GroupEntity (groupKey BIGINT NOT NULL, created_by VARCHAR(255) NOT NULL, created_date TIMESTAMP, defaultGroup BOOLEAN NOT NULL, deleted BOOLEAN NOT NULL, description VARCHAR(2048) NOT NULL, groupId VARCHAR NOT NULL, groupName VARCHAR(255) NOT NULL, modified_by VARCHAR(255) NOT NULL, modified_date TIMESTAMP NOT NULL, version INTEGER, PRIMARY KEY (groupKey)) -CREATE TABLE PdpEntity (pdpKey BIGINT NOT NULL, 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)) -CREATE TABLE ActionBodyEntity (actionBodyId BIGINT NOT NULL, 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)) -CREATE TABLE DatabaseLockEntity (lock_key INTEGER NOT NULL, PRIMARY KEY (lock_key)) -CREATE TABLE PolicyVersion (id INTEGER NOT NULL, ACTIVE_VERSION INTEGER, CREATED_BY VARCHAR(45) NOT NULL, created_date TIMESTAMP NOT NULL, HIGHEST_VERSION INTEGER, modified_by VARCHAR(45) NOT NULL, modified_date TIMESTAMP NOT NULL, POLICY_NAME VARCHAR(255) NOT NULL, PRIMARY KEY (id)) -CREATE TABLE POLICYSCORE (id INTEGER NOT NULL, POLICY_NAME VARCHAR NOT NULL, POLICY_SCORE VARCHAR, VERSIONEXTENSION VARCHAR NOT NULL, PRIMARY KEY (id)) -CREATE TABLE 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)) -CREATE TABLE Attribute (id INTEGER NOT NULL, ATTRIBUTE_VALUE VARCHAR, created_date TIMESTAMP, description VARCHAR(2048), is_designator CHAR NOT NULL, modified_date TIMESTAMP NOT NULL, PRIORITY VARCHAR, selector_path VARCHAR(2048), xacml_id VARCHAR NOT NULL UNIQUE, category INTEGER, constraint_type INTEGER, datatype INTEGER, created_by VARCHAR(45), modified_by VARCHAR(45), PRIMARY KEY (id)) -CREATE TABLE 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)) -CREATE TABLE ConstraintType (id INTEGER NOT NULL, constraint_type VARCHAR(64) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY (id)) -CREATE TABLE ConstraintValues (id INTEGER NOT NULL, property VARCHAR, value VARCHAR, attribute_id INTEGER, PRIMARY KEY (id)) -CREATE TABLE 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)) -CREATE TABLE FunctionArguments (id INTEGER NOT NULL, arg_index INTEGER NOT NULL, is_bag INTEGER NOT NULL, datatype_id INTEGER, function_id INTEGER, PRIMARY KEY (id)) -CREATE TABLE UserInfo (loginid VARCHAR(45) NOT NULL, name VARCHAR NOT NULL UNIQUE, PRIMARY KEY (loginid)) -CREATE TABLE ActionPolicyDict (id INTEGER NOT NULL, ATTRIBUTE_NAME VARCHAR NOT NULL, Body VARCHAR, created_date TIMESTAMP, description VARCHAR(2048), Headers VARCHAR, Method VARCHAR NOT NULL, modified_date TIMESTAMP NOT NULL, Type VARCHAR NOT NULL, URL VARCHAR NOT NULL, created_by VARCHAR(45), modified_by VARCHAR(45), PRIMARY KEY (id)) -CREATE TABLE DecisionSettings (id INTEGER NOT NULL, created_date TIMESTAMP, description VARCHAR(2048), modified_date TIMESTAMP NOT NULL, PRIORITY VARCHAR, xacml_id VARCHAR NOT NULL UNIQUE, datatype INTEGER, created_by VARCHAR(45), modified_by VARCHAR(45), PRIMARY KEY (id)) -CREATE TABLE MicroServiceModels (id INTEGER NOT NULL, annotation VARCHAR(2000) NOT NULL, attributes VARCHAR(255) NOT NULL, dependency VARCHAR(2048), description VARCHAR(2048), enumValues VARCHAR(2000) NOT NULL, modelName VARCHAR NOT NULL UNIQUE, ref_attributes VARCHAR(255) NOT NULL, sub_attributes VARCHAR(2000) NOT NULL, version VARCHAR(2000) NOT NULL, imported_by VARCHAR(45), PRIMARY KEY (id)) -CREATE TABLE actionlist (id INTEGER NOT NULL, actionname VARCHAR NOT NULL, description VARCHAR, PRIMARY KEY (id)) -CREATE TABLE AddressGroup (id INTEGER NOT NULL, description VARCHAR, name VARCHAR NOT NULL, prefixlist VARCHAR, PRIMARY KEY (id)) -CREATE TABLE AttributeAssignment (id INTEGER NOT NULL, attribute_id INTEGER, expression VARCHAR NOT NULL, OBADVICE_id INTEGER, PRIMARY KEY (id)) -CREATE TABLE BRMSParamTemplate (id INTEGER NOT NULL, created_date TIMESTAMP, description VARCHAR(2048), rule LONGVARCHAR NOT NULL, param_template_name VARCHAR NOT NULL UNIQUE, |