Merge "aai-schema introduce composed-resource to build parent child relationship between service instances this allows us to identify which object is parent and which is child service Issue-ID: AAI-3104"
diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java
index 39eb9d9..d9c544d 100644
--- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java
+++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java
@@ -221,6 +221,11 @@
try {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
dbFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ dbFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+ dbFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
+ dbFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ dbFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+ dbFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
dBuilder = dbFactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw e;
diff --git a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java
index 16136d5..2c32985 100644
--- a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java
+++ b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java
@@ -113,6 +113,11 @@
Set<String> types = new HashSet<>();
final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ docFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+ docFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
+ docFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+ docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
ArrayList<Node> javaTypes = new ArrayList<>();
@@ -136,6 +141,11 @@
private Document createCombinedSchema(List<String> files, SchemaVersion v) throws ParserConfigurationException, SAXException, IOException {
final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ docFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+ docFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
+ docFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+ docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
DocumentBuilder masterDocBuilder = docFactory.newDocumentBuilder();
Document combinedDoc = masterDocBuilder.parse(getShell(v));
diff --git a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/validation/DefaultDuplicateNodeDefinitionValidationModule.java b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/validation/DefaultDuplicateNodeDefinitionValidationModule.java
index 915a54d..ac3a450 100644
--- a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/validation/DefaultDuplicateNodeDefinitionValidationModule.java
+++ b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/validation/DefaultDuplicateNodeDefinitionValidationModule.java
@@ -54,6 +54,11 @@
try {
final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ docFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+ docFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
+ docFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
+ docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
final DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Multimap<String, String> types = ArrayListMultimap.create();
diff --git a/aai-schema/src/main/resources/onap/dbedgerules/v24/DbEdgeRules_ccvpn_v24.json b/aai-schema/src/main/resources/onap/dbedgerules/v24/DbEdgeRules_ccvpn_v24.json
index 0c7e77c..09852d6 100644
--- a/aai-schema/src/main/resources/onap/dbedgerules/v24/DbEdgeRules_ccvpn_v24.json
+++ b/aai-schema/src/main/resources/onap/dbedgerules/v24/DbEdgeRules_ccvpn_v24.json
@@ -52,6 +52,30 @@
{
"from": "connectivity",
"to": "vpn-binding",
+ "label": "tosca.relationships.network.BindsTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"For CCVPN Usecase"
+ },
+ {
+ "from": "connectivity",
+ "to": "connectivity",
+ "label": "tosca.relationships.network.LinksTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"For CCVPN Usecase -- ETree super and slave connectivity"
+ },
+ {
+ "from": "connectivity",
+ "to": "uni",
"label": "org.onap.relationships.inventory.PartOf",
"direction": "OUT",
"multiplicity": "ONE2MANY",
@@ -59,7 +83,7 @@
"delete-other-v": "NONE",
"prevent-delete": "NONE",
"default": "true",
- "description":"For CCVPN Usecase"
+ "description":"For CCVPN Usecase -- ETree"
},
{
"from": "lan-port-config",