diff options
author | Yuli Shlosberg <ys9693@att.com> | 2018-03-06 17:51:15 +0200 |
---|---|---|
committer | Yuli Shlosberg <ys9693@att.com> | 2018-03-07 14:21:48 +0200 |
commit | 76bdc498d5e7a1e5515714fe042bf111f10d6c26 (patch) | |
tree | de8123ae36d9a00b16f7a58fc7db2f020fe141a8 /src | |
parent | 121a7a375d1cea2764dfc34d82f4e2f252099a33 (diff) |
update JTOSCA package names
Change-Id: I8e9ed44a57521047c5c8218dfeef0a3193d570ee
Issue-ID: SDC-950
Signed-off-by: Yuli Shlosberg <ys9693@att.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/CapabilityAssignment.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/CapabilityAssignment.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/CapabilityAssignments.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/CapabilityAssignments.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java) | 18 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/EntityTemplate.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/EntityTemplate.java) | 11 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/Group.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/Group.java) | 11 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/ImportsLoader.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java) | 12 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/NodeTemplate.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/NodeTemplate.java) | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/Policy.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/Policy.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/Property.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/Property.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/RelationshipTemplate.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/RelationshipTemplate.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/Repository.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/Repository.java) | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/RequirementAssignment.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/RequirementAssignment.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/RequirementAssignments.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/RequirementAssignments.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/SubstitutionMappings.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java) | 16 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/TopologyTemplate.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java) | 24 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/ToscaGraph.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/ToscaGraph.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/ToscaTemplate.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java) | 24 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/Triggers.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/Triggers.java) | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/UnsupportedType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/UnsupportedType.java) | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/common/JToscaException.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/common/JToscaException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/common/JToscaValidationIssue.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/common/JToscaValidationIssue.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/common/TOSCAException.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/common/TOSCAException.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/common/ValidationIssueCollector.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/common/ValidationIssueCollector.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/ArtifactTypeDef.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/ArtifactTypeDef.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/AttributeDef.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/AttributeDef.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/CapabilityTypeDef.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/CapabilityTypeDef.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/DataType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/DataType.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/EntityType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/EntityType.java) | 12 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/GroupType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/GroupType.java) | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/InterfacesDef.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/InterfacesDef.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/Metadata.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/Metadata.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/NodeType.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/PolicyType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/PolicyType.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/PortSpec.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/PortSpec.java) | 11 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/PropertyDef.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/PropertyDef.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/RelationshipType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/RelationshipType.java) | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnit.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnit.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitFrequency.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitFrequency.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitSize.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitSize.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitTime.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitTime.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/StatefulEntityType.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/StatefulEntityType.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/TypeValidation.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/TypeValidation.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Constraint.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Constraint.java) | 12 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Equal.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Equal.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/GreaterOrEqual.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/GreaterOrEqual.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/GreaterThan.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/GreaterThan.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/InRange.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/InRange.java) | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Length.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Length.java) | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/LessOrEqual.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/LessOrEqual.java) | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/LessThan.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/LessThan.java) | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/MaxLength.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/MaxLength.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/MinLength.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/MinLength.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Pattern.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Pattern.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Schema.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Schema.java) | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/ValidValues.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/ValidValues.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/extensions/ExtTools.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/functions/Concat.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/functions/Concat.java) | 13 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/functions/Function.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java) | 5 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/functions/GetAttribute.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetAttribute.java) | 27 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/functions/GetInput.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java) | 14 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/functions/GetOperationOutput.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetOperationOutput.java) | 21 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/functions/GetProperty.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java) | 27 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/functions/Token.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/functions/Token.java) | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/parameters/Input.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java) | 14 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/parameters/Output.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Output.java) | 6 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/prereq/CSAR.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java) | 16 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/utils/CopyUtils.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/utils/CopyUtils.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/utils/DumpUtils.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/utils/DumpUtils.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/utils/JToscaErrorCodes.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/utils/JToscaErrorCodes.java) | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/utils/TOSCAVersionProperty.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/utils/TOSCAVersionProperty.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/utils/ThreadLocalsHolder.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/utils/ThreadLocalsHolder.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/utils/UrlUtils.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/utils/UrlUtils.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java (renamed from src/main/java/org/openecomp/sdc/toscaparser/api/utils/ValidateUtils.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Schema.java.orig | 281 | ||||
-rw-r--r-- | src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java.orig | 767 | ||||
-rw-r--r-- | src/test/java/org/onap/sdc/toscaparser/api/GetValidationIssues.java (renamed from src/test/java/org/openecomp/sdc/toscaparser/api/GetValidationIssues.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/sdc/toscaparser/api/JToscaImportTest.java (renamed from src/test/java/org/openecomp/sdc/toscaparser/api/JToscaImportTest.java) | 6 | ||||
-rw-r--r-- | src/test/java/org/onap/sdc/toscaparser/api/JToscaMetadataParse.java (renamed from src/test/java/org/openecomp/sdc/toscaparser/api/JToscaMetadataParse.java) | 8 | ||||
-rw-r--r-- | src/test/java/org/onap/sdc/toscaparser/api/elements/EntityTypeTest.java (renamed from src/test/java/org/openecomp/sdc/toscaparser/api/elements/EntityTypeTest.java) | 3 |
79 files changed, 295 insertions, 1359 deletions
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/CapabilityAssignment.java b/src/main/java/org/onap/sdc/toscaparser/api/CapabilityAssignment.java index f3bc2bd..8f18cc3 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/CapabilityAssignment.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/CapabilityAssignment.java @@ -1,11 +1,11 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.elements.CapabilityTypeDef; -import org.openecomp.sdc.toscaparser.api.elements.PropertyDef; +import org.onap.sdc.toscaparser.api.elements.CapabilityTypeDef; +import org.onap.sdc.toscaparser.api.elements.PropertyDef; public class CapabilityAssignment { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/CapabilityAssignments.java b/src/main/java/org/onap/sdc/toscaparser/api/CapabilityAssignments.java index 3397960..d0c6a7f 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/CapabilityAssignments.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/CapabilityAssignments.java @@ -1,6 +1,4 @@ -package org.openecomp.sdc.toscaparser.api; - -import org.openecomp.sdc.toscaparser.api.CapabilityAssignment; +package org.onap.sdc.toscaparser.api; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java b/src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java index 08e154f..2a12a71 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java @@ -1,17 +1,17 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.elements.*; -import org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint; -import org.openecomp.sdc.toscaparser.api.elements.constraints.Schema; -import org.openecomp.sdc.toscaparser.api.functions.Function; -import org.openecomp.sdc.toscaparser.api.utils.TOSCAVersionProperty; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.ValidateUtils; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.elements.*; +import org.onap.sdc.toscaparser.api.elements.constraints.Constraint; +import org.onap.sdc.toscaparser.api.elements.constraints.Schema; +import org.onap.sdc.toscaparser.api.functions.Function; +import org.onap.sdc.toscaparser.api.utils.TOSCAVersionProperty; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ValidateUtils; public class DataEntity { // A complex data value entity diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/EntityTemplate.java b/src/main/java/org/onap/sdc/toscaparser/api/EntityTemplate.java index ed19d88..95c97dd 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/EntityTemplate.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/EntityTemplate.java @@ -1,8 +1,9 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; + +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.elements.*; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.elements.*; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -46,7 +47,7 @@ public abstract class EntityTemplate { protected LinkedHashMap<String,Object> customDef; protected StatefulEntityType typeDefinition; private ArrayList<Property> _properties; - private ArrayList<InterfacesDef> _interfaces; + private ArrayList<InterfacesDef> _interfaces; private ArrayList<RequirementAssignment> _requirements; private ArrayList<CapabilityAssignment> _capabilities; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/Group.java b/src/main/java/org/onap/sdc/toscaparser/api/Group.java index d183ac7..f678083 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/Group.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/Group.java @@ -1,15 +1,14 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ValidateUtils; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.ValidateUtils; - public class Group extends EntityTemplate { private static final String TYPE = "type"; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java b/src/main/java/org/onap/sdc/toscaparser/api/ImportsLoader.java index b2a0da7..76800f7 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/ImportsLoader.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/ImportsLoader.java @@ -1,10 +1,10 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.UrlUtils; -import org.openecomp.sdc.toscaparser.api.elements.TypeValidation; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.UrlUtils; +import org.onap.sdc.toscaparser.api.elements.TypeValidation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; @@ -45,7 +45,7 @@ public class ImportsLoader { if((_path == null || _path.isEmpty()) && tpl == null) { //msg = _('Input tosca template is not provided.') //log.warning(msg) - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE184", "ValidationError: Input tosca template is not provided")); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE184", "ValidationError: Input tosca template is not provided")); } this.path = _path; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/NodeTemplate.java b/src/main/java/org/onap/sdc/toscaparser/api/NodeTemplate.java index 1e97572..250ef42 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/NodeTemplate.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/NodeTemplate.java @@ -1,15 +1,15 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.elements.*; -import org.openecomp.sdc.toscaparser.api.utils.CopyUtils; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.elements.*; +import org.onap.sdc.toscaparser.api.utils.CopyUtils; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class NodeTemplate extends EntityTemplate { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/Policy.java b/src/main/java/org/onap/sdc/toscaparser/api/Policy.java index 26805bd..f7ec967 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/Policy.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/Policy.java @@ -1,13 +1,13 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.ValidateUtils; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ValidateUtils; public class Policy extends EntityTemplate { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/Property.java b/src/main/java/org/onap/sdc/toscaparser/api/Property.java index 731bc73..227da0a 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/Property.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/Property.java @@ -1,11 +1,11 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint; -import org.openecomp.sdc.toscaparser.api.elements.constraints.Schema; -import org.openecomp.sdc.toscaparser.api.functions.Function; +import org.onap.sdc.toscaparser.api.elements.constraints.Constraint; +import org.onap.sdc.toscaparser.api.elements.constraints.Schema; +import org.onap.sdc.toscaparser.api.functions.Function; public class Property { // TOSCA built-in Property type diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/RelationshipTemplate.java b/src/main/java/org/onap/sdc/toscaparser/api/RelationshipTemplate.java index 10d3ad9..a94caed 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/RelationshipTemplate.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/RelationshipTemplate.java @@ -1,12 +1,12 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.elements.EntityType; -import org.openecomp.sdc.toscaparser.api.elements.PropertyDef; -import org.openecomp.sdc.toscaparser.api.elements.StatefulEntityType; +import org.onap.sdc.toscaparser.api.elements.PropertyDef; +import org.onap.sdc.toscaparser.api.elements.StatefulEntityType; +import org.onap.sdc.toscaparser.api.elements.EntityType; public class RelationshipTemplate extends EntityTemplate { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/Repository.java b/src/main/java/org/onap/sdc/toscaparser/api/Repository.java index 3ede22c..5bed453 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/Repository.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/Repository.java @@ -1,12 +1,11 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.UrlUtils; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.UrlUtils; - public class Repository { private static final String DESCRIPTION = "description"; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/RequirementAssignment.java b/src/main/java/org/onap/sdc/toscaparser/api/RequirementAssignment.java index 799a8ee..1b4e243 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/RequirementAssignment.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/RequirementAssignment.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import java.util.Map; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/RequirementAssignments.java b/src/main/java/org/onap/sdc/toscaparser/api/RequirementAssignments.java index 7991f3c..b6b9ea4 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/RequirementAssignments.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/RequirementAssignments.java @@ -1,6 +1,4 @@ -package org.openecomp.sdc.toscaparser.api; - -import org.openecomp.sdc.toscaparser.api.RequirementAssignment; +package org.onap.sdc.toscaparser.api; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java b/src/main/java/org/onap/sdc/toscaparser/api/SubstitutionMappings.java index e5e9d9a..a87ea6c 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/SubstitutionMappings.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/SubstitutionMappings.java @@ -1,11 +1,11 @@ -package org.openecomp.sdc.toscaparser.api; - -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.elements.NodeType; -import org.openecomp.sdc.toscaparser.api.elements.PropertyDef; -import org.openecomp.sdc.toscaparser.api.parameters.Input; -import org.openecomp.sdc.toscaparser.api.parameters.Output; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +package org.onap.sdc.toscaparser.api; + +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.elements.NodeType; +import org.onap.sdc.toscaparser.api.elements.PropertyDef; +import org.onap.sdc.toscaparser.api.parameters.Input; +import org.onap.sdc.toscaparser.api.parameters.Output; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.HashSet; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java b/src/main/java/org/onap/sdc/toscaparser/api/TopologyTemplate.java index c19623f..e2c268e 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/TopologyTemplate.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/TopologyTemplate.java @@ -1,15 +1,15 @@ -package org.openecomp.sdc.toscaparser.api; - -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.elements.InterfacesDef; -import org.openecomp.sdc.toscaparser.api.elements.NodeType; -import org.openecomp.sdc.toscaparser.api.elements.RelationshipType; -import org.openecomp.sdc.toscaparser.api.functions.Function; -import org.openecomp.sdc.toscaparser.api.functions.GetAttribute; -import org.openecomp.sdc.toscaparser.api.functions.GetInput; -import org.openecomp.sdc.toscaparser.api.parameters.Input; -import org.openecomp.sdc.toscaparser.api.parameters.Output; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +package org.onap.sdc.toscaparser.api; + +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.elements.InterfacesDef; +import org.onap.sdc.toscaparser.api.elements.NodeType; +import org.onap.sdc.toscaparser.api.elements.RelationshipType; +import org.onap.sdc.toscaparser.api.functions.Function; +import org.onap.sdc.toscaparser.api.functions.GetAttribute; +import org.onap.sdc.toscaparser.api.functions.GetInput; +import org.onap.sdc.toscaparser.api.parameters.Input; +import org.onap.sdc.toscaparser.api.parameters.Output; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.HashSet; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaGraph.java b/src/main/java/org/onap/sdc/toscaparser/api/ToscaGraph.java index 2de3bb9..fa371c3 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaGraph.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/ToscaGraph.java @@ -1,9 +1,9 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.elements.RelationshipType; +import org.onap.sdc.toscaparser.api.elements.RelationshipType; //import java.util.Iterator; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java b/src/main/java/org/onap/sdc/toscaparser/api/ToscaTemplate.java index e96ca56..3d94d6e 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/ToscaTemplate.java @@ -1,6 +1,9 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.ValidationIssueCollector; +import org.onap.sdc.toscaparser.api.parameters.Output; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.io.File; import java.io.FileInputStream; @@ -13,16 +16,13 @@ import java.nio.file.Files; import java.util.function.Predicate; import java.nio.file.Paths; -import org.openecomp.sdc.toscaparser.api.common.ValidationIssueCollector; -import org.openecomp.sdc.toscaparser.api.common.JToscaException; -import org.openecomp.sdc.toscaparser.api.elements.EntityType; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; -import org.openecomp.sdc.toscaparser.api.extensions.ExtTools; -import org.openecomp.sdc.toscaparser.api.parameters.Input; -import org.openecomp.sdc.toscaparser.api.parameters.Output; -import org.openecomp.sdc.toscaparser.api.prereq.CSAR; -import org.openecomp.sdc.toscaparser.api.utils.JToscaErrorCodes; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaException; +import org.onap.sdc.toscaparser.api.elements.EntityType; +import org.onap.sdc.toscaparser.api.elements.Metadata; +import org.onap.sdc.toscaparser.api.extensions.ExtTools; +import org.onap.sdc.toscaparser.api.parameters.Input; +import org.onap.sdc.toscaparser.api.prereq.CSAR; +import org.onap.sdc.toscaparser.api.utils.JToscaErrorCodes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/Triggers.java b/src/main/java/org/onap/sdc/toscaparser/api/Triggers.java index 1e82a6c..cfe0138 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/Triggers.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/Triggers.java @@ -1,12 +1,11 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ValidateUtils; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.ValidateUtils; - public class Triggers extends EntityTemplate { private static final String DESCRIPTION = "description"; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/UnsupportedType.java b/src/main/java/org/onap/sdc/toscaparser/api/UnsupportedType.java index 73858c6..1117190 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/UnsupportedType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/UnsupportedType.java @@ -1,8 +1,7 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; - -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class UnsupportedType { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/common/JToscaException.java b/src/main/java/org/onap/sdc/toscaparser/api/common/JToscaException.java index f97e6ad..ffe936d 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/common/JToscaException.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/common/JToscaException.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.common; +package org.onap.sdc.toscaparser.api.common; public class JToscaException extends Exception { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/common/JToscaValidationIssue.java b/src/main/java/org/onap/sdc/toscaparser/api/common/JToscaValidationIssue.java index 5caba26..d31735f 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/common/JToscaValidationIssue.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/common/JToscaValidationIssue.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.common; +package org.onap.sdc.toscaparser.api.common; public class JToscaValidationIssue { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/common/TOSCAException.java b/src/main/java/org/onap/sdc/toscaparser/api/common/TOSCAException.java index cfd7560..efc834a 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/common/TOSCAException.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/common/TOSCAException.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.common; +package org.onap.sdc.toscaparser.api.common; import java.util.IllegalFormatException; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/common/ValidationIssueCollector.java b/src/main/java/org/onap/sdc/toscaparser/api/common/ValidationIssueCollector.java index 6e2961a..81e3e33 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/common/ValidationIssueCollector.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/common/ValidationIssueCollector.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.common; +package org.onap.sdc.toscaparser.api.common; import java.util.*; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ArtifactTypeDef.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/ArtifactTypeDef.java index 8a13d99..e5cbf90 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ArtifactTypeDef.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/ArtifactTypeDef.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.util.LinkedHashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/AttributeDef.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/AttributeDef.java index 5551908..702094f 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/AttributeDef.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/AttributeDef.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.util.LinkedHashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/CapabilityTypeDef.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/CapabilityTypeDef.java index 2994fa8..e64f1b8 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/CapabilityTypeDef.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/CapabilityTypeDef.java @@ -1,11 +1,9 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.elements.PropertyDef; - public class CapabilityTypeDef extends StatefulEntityType { // TOSCA built-in capabilities type diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/DataType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/DataType.java index d5d770b..17f1ad4 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/DataType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/DataType.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.util.ArrayList; import java.util.LinkedHashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/EntityType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/EntityType.java index 50ef715..e2ad766 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/EntityType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/EntityType.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.io.IOException; import java.io.InputStream; @@ -6,10 +6,10 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.extensions.ExtTools; -import org.openecomp.sdc.toscaparser.api.utils.CopyUtils; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.CopyUtils; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.extensions.ExtTools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; @@ -269,7 +269,7 @@ public class EntityType { from toscaparser.common.exception import ValidationIssueCollector from toscaparser.common.exception import ValidationError from toscaparser.extensions.exttools import ExtTools -import org.openecomp.sdc.toscaparser.api.utils.yamlparser +import org.onap.sdc.toscaparser.api.utils.yamlparser log = logging.getLogger('tosca') diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/GroupType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/GroupType.java index 0f6ae6d..1419461 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/GroupType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/GroupType.java @@ -1,11 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; - public class GroupType extends StatefulEntityType { private static final String DERIVED_FROM = "derived_from"; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/InterfacesDef.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/InterfacesDef.java index 357ee23..f8669ed 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/InterfacesDef.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/InterfacesDef.java @@ -1,8 +1,8 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.EntityTemplate; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.EntityTemplate; import java.util.ArrayList; import java.util.LinkedHashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/Metadata.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/Metadata.java index b153876..6b818f5 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/Metadata.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/Metadata.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.util.AbstractMap; import java.util.HashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/NodeType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java index 48fbe59..7dcc44d 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/NodeType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java @@ -1,7 +1,7 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -134,7 +134,7 @@ public class NodeType extends StatefulEntityType { // Filter the node types ArrayList<String> nodeTypes = new ArrayList<>(); for(String nt: customDef.keySet()) { - if(nt.startsWith(NODE_PREFIX) || nt.startsWith("org.openecomp") && !nt.equals("tosca.nodes.Root")) { + if(nt.startsWith(NODE_PREFIX) || nt.startsWith("org.onap") && !nt.equals("tosca.nodes.Root")) { nodeTypes.add(nt); } } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/PolicyType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/PolicyType.java index b046a48..0a36a35 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/PolicyType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/PolicyType.java @@ -1,12 +1,12 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.TOSCAVersionProperty; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.TOSCAVersionProperty; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class PolicyType extends StatefulEntityType { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/PortSpec.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/PortSpec.java index 1a6745c..8fb65df 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/PortSpec.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/PortSpec.java @@ -1,13 +1,12 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.DataEntity; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ValidateUtils; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.DataEntity; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.ValidateUtils; - public class PortSpec { // Parent class for tosca.datatypes.network.PortSpec type diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/PropertyDef.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/PropertyDef.java index bdd376b..e37603d 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/PropertyDef.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/PropertyDef.java @@ -1,10 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class PropertyDef { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/RelationshipType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/RelationshipType.java index 3a56840..0197d54 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/RelationshipType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/RelationshipType.java @@ -1,11 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; - public class RelationshipType extends StatefulEntityType { private static final String DERIVED_FROM = "derived_from"; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnit.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnit.java index 77cd4c2..f7f2a8a 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnit.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnit.java @@ -1,12 +1,12 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import java.util.HashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.ValidateUtils; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ValidateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitFrequency.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitFrequency.java index 57a111e..6c05c43 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitFrequency.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitFrequency.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; public class ScalarUnitFrequency extends ScalarUnit { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitSize.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitSize.java index 72e7c33..c788c32 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitSize.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitSize.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; public class ScalarUnitSize extends ScalarUnit { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitTime.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitTime.java index 5cde10a..274fbf0 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/ScalarUnitTime.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/ScalarUnitTime.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; public class ScalarUnitTime extends ScalarUnit { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/StatefulEntityType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/StatefulEntityType.java index 0a83cb1..b9ce6c8 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/StatefulEntityType.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/StatefulEntityType.java @@ -1,13 +1,13 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.UnsupportedType; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.UnsupportedType; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class StatefulEntityType extends EntityType { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/TypeValidation.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/TypeValidation.java index 7bfe333..3376c69 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/TypeValidation.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/TypeValidation.java @@ -1,12 +1,12 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.extensions.ExtTools; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.extensions.ExtTools; public class TypeValidation { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Constraint.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Constraint.java index 5cf7444..fb183f8 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Constraint.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Constraint.java @@ -1,12 +1,12 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.elements.ScalarUnit; -import org.openecomp.sdc.toscaparser.api.functions.Function; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.elements.ScalarUnit; +import org.onap.sdc.toscaparser.api.functions.Function; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public abstract class Constraint { @@ -36,7 +36,7 @@ public abstract class Constraint { if(!(constraint instanceof LinkedHashMap) || ((LinkedHashMap<String,Object>)constraint).size() != 1) { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE101", + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE101", "InvalidSchemaError: Invalid constraint schema " + constraint.toString())); } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Equal.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Equal.java index e16cac3..c9a66d9 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Equal.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Equal.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; public class Equal extends Constraint { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/GreaterOrEqual.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/GreaterOrEqual.java index ad6183e..f9275a5 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/GreaterOrEqual.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/GreaterOrEqual.java @@ -1,11 +1,11 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.Date; -import org.openecomp.sdc.toscaparser.api.functions.Function; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.functions.Function; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class GreaterOrEqual extends Constraint { // Constraint class for "greater_or_equal" diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/GreaterThan.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/GreaterThan.java index b9e06b3..1ffe3f1 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/GreaterThan.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/GreaterThan.java @@ -1,10 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.Date; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class GreaterThan extends Constraint { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/InRange.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/InRange.java index 7d0d654..829bc1f 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/InRange.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/InRange.java @@ -1,11 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.Date; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; - import java.util.ArrayList; public class InRange extends Constraint { @@ -47,7 +46,7 @@ public class InRange extends Constraint { super(name,type,c); if(!(constraintValue instanceof ArrayList) || ((ArrayList<Object>)constraintValue).size() != 2) { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE106", "InvalidSchemaError: The property \"in_range\" expects a list")); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE106", "InvalidSchemaError: The property \"in_range\" expects a list")); } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Length.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Length.java index c94cda5..db0eaac 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Length.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Length.java @@ -1,8 +1,7 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; - -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class Length extends Constraint { // Constraint class for "length" @@ -24,7 +23,7 @@ public class Length extends Constraint { super(name,type,c); if(!validTypes.contains(constraintValue.getClass().getSimpleName())) { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE109", "InvalidSchemaError: The property \"length\" expects an integer")); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE109", "InvalidSchemaError: The property \"length\" expects an integer")); } } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/LessOrEqual.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/LessOrEqual.java index 1601e27..7ea333d 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/LessOrEqual.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/LessOrEqual.java @@ -1,10 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.Date; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class LessOrEqual extends Constraint { // Constraint class for "less_or_equal" @@ -38,7 +38,7 @@ public class LessOrEqual extends Constraint { super(name,type,c); if(!validTypes.contains(constraintValue.getClass().getSimpleName())) { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE110", "InvalidSchemaError: The property \"less_or_equal\" expects comparable values")); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE110", "InvalidSchemaError: The property \"less_or_equal\" expects comparable values")); } } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/LessThan.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/LessThan.java index b867fa7..428f10c 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/LessThan.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/LessThan.java @@ -1,11 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.Date; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; - public class LessThan extends Constraint { @Override @@ -36,7 +35,7 @@ public class LessThan extends Constraint { super(name,type,c); if(!validTypes.contains(constraintValue.getClass().getSimpleName())) { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE111", "InvalidSchemaError: The property \"less_than\" expects comparable values")); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE111", "InvalidSchemaError: The property \"less_than\" expects comparable values")); } } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/MaxLength.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/MaxLength.java index 48ac349..7ac7df9 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/MaxLength.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/MaxLength.java @@ -1,10 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class MaxLength extends Constraint { // Constraint class for "min_length" diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/MinLength.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/MinLength.java index 0203484..fa1fbe2 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/MinLength.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/MinLength.java @@ -1,10 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class MinLength extends Constraint { // Constraint class for "min_length" diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Pattern.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Pattern.java index a29bac6..cf3b856 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Pattern.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Pattern.java @@ -1,11 +1,11 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.regex.Matcher; import java.util.regex.PatternSyntaxException; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class Pattern extends Constraint { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Schema.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Schema.java index d0ee118..73a63ef 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Schema.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/Schema.java @@ -1,14 +1,13 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; - public class Schema { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/ValidValues.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/ValidValues.java index 60b6be2..23f25ed 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/ValidValues.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/constraints/ValidValues.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; +package org.onap.sdc.toscaparser.api.elements.constraints; import java.util.ArrayList; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java b/src/main/java/org/onap/sdc/toscaparser/api/extensions/ExtTools.java index f0e0afa..4a8309e 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/extensions/ExtTools.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/extensions/ExtTools.java @@ -1,7 +1,7 @@ -package org.openecomp.sdc.toscaparser.api.extensions; +package org.onap.sdc.toscaparser.api.extensions; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import org.reflections.Reflections; import org.reflections.scanners.ResourcesScanner; import org.slf4j.Logger; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Concat.java b/src/main/java/org/onap/sdc/toscaparser/api/functions/Concat.java index 84afbc9..0b09c73 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Concat.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/functions/Concat.java @@ -1,12 +1,11 @@ -package org.openecomp.sdc.toscaparser.api.functions; +package org.onap.sdc.toscaparser.api.functions; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.TopologyTemplate; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; -import org.openecomp.sdc.toscaparser.api.TopologyTemplate; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; - public class Concat extends Function { // Validate the function and provide an instance of the function @@ -26,7 +25,7 @@ public class Concat extends Function { // get_attribute: [ server, port ] ] - public Concat(TopologyTemplate ttpl,Object context,String name,ArrayList<Object> args) { + public Concat(TopologyTemplate ttpl, Object context, String name, ArrayList<Object> args) { super(ttpl,context,name,args); } @@ -38,7 +37,7 @@ public class Concat extends Function { @Override void validate() { if(args.size() < 1) { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE145", + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE145", "ValueError: Invalid arguments for function \"concat\". " + "Expected at least one argument")); } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java b/src/main/java/org/onap/sdc/toscaparser/api/functions/Function.java index 3437735..cb40c4c 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Function.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/functions/Function.java @@ -1,9 +1,8 @@ -package org.openecomp.sdc.toscaparser.api.functions; +package org.onap.sdc.toscaparser.api.functions; import java.util.*; -import org.openecomp.sdc.toscaparser.api.TopologyTemplate; -import org.openecomp.sdc.toscaparser.api.ToscaTemplate; +import org.onap.sdc.toscaparser.api.TopologyTemplate; public abstract class Function { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetAttribute.java b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetAttribute.java index 5433aac..8648e4e 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetAttribute.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetAttribute.java @@ -1,21 +1,22 @@ -package org.openecomp.sdc.toscaparser.api.functions; +package org.onap.sdc.toscaparser.api.functions; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.*; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.*; -import org.openecomp.sdc.toscaparser.api.elements.AttributeDef; -import org.openecomp.sdc.toscaparser.api.elements.CapabilityTypeDef; -import org.openecomp.sdc.toscaparser.api.elements.DataType; -import org.openecomp.sdc.toscaparser.api.elements.EntityType; -import org.openecomp.sdc.toscaparser.api.elements.NodeType; -import org.openecomp.sdc.toscaparser.api.elements.PropertyDef; -import org.openecomp.sdc.toscaparser.api.elements.RelationshipType; -import org.openecomp.sdc.toscaparser.api.elements.StatefulEntityType; -import org.openecomp.sdc.toscaparser.api.elements.constraints.Schema; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.*; +import org.onap.sdc.toscaparser.api.elements.AttributeDef; +import org.onap.sdc.toscaparser.api.elements.CapabilityTypeDef; +import org.onap.sdc.toscaparser.api.elements.DataType; +import org.onap.sdc.toscaparser.api.elements.EntityType; +import org.onap.sdc.toscaparser.api.elements.NodeType; +import org.onap.sdc.toscaparser.api.elements.PropertyDef; +import org.onap.sdc.toscaparser.api.elements.RelationshipType; +import org.onap.sdc.toscaparser.api.elements.StatefulEntityType; +import org.onap.sdc.toscaparser.api.elements.constraints.Schema; public class GetAttribute extends Function { // Get an attribute value of an entity defined in the service template diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetInput.java index 0c96b0f..262d99a 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetInput.java @@ -1,17 +1,17 @@ -package org.openecomp.sdc.toscaparser.api.functions; +package org.onap.sdc.toscaparser.api.functions; -import org.openecomp.sdc.toscaparser.api.DataEntity; -import org.openecomp.sdc.toscaparser.api.TopologyTemplate; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; -import org.openecomp.sdc.toscaparser.api.parameters.Input; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.DataEntity; +import org.onap.sdc.toscaparser.api.TopologyTemplate; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.parameters.Input; import java.util.ArrayList; import java.util.LinkedHashMap; public class GetInput extends Function { - public GetInput(TopologyTemplate toscaTpl,Object context,String name,ArrayList<Object> _args) { + public GetInput(TopologyTemplate toscaTpl, Object context, String name, ArrayList<Object> _args) { super(toscaTpl,context,name,_args); } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetOperationOutput.java b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetOperationOutput.java index 7af7eeb..342e18a 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetOperationOutput.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetOperationOutput.java @@ -1,18 +1,21 @@ -package org.openecomp.sdc.toscaparser.api.functions; +package org.onap.sdc.toscaparser.api.functions; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.EntityTemplate; +import org.onap.sdc.toscaparser.api.NodeTemplate; +import org.onap.sdc.toscaparser.api.RelationshipTemplate; +import org.onap.sdc.toscaparser.api.TopologyTemplate; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.elements.InterfacesDef; +import org.onap.sdc.toscaparser.api.elements.RelationshipType; +import org.onap.sdc.toscaparser.api.elements.StatefulEntityType; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; -import org.openecomp.sdc.toscaparser.api.*; -import org.openecomp.sdc.toscaparser.api.elements.InterfacesDef; -import org.openecomp.sdc.toscaparser.api.elements.RelationshipType; -import org.openecomp.sdc.toscaparser.api.elements.StatefulEntityType; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class GetOperationOutput extends Function { - public GetOperationOutput(TopologyTemplate ttpl,Object context,String name,ArrayList<Object> args) { + public GetOperationOutput(TopologyTemplate ttpl, Object context, String name, ArrayList<Object> args) { super(ttpl,context,name,args); } @@ -24,7 +27,7 @@ public class GetOperationOutput extends Function { _findOperationName(interfaceName,(String)args.get(2)); } else { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE159", + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE159", "ValueError: Illegal arguments for function \"get_operation_output\". " + "Expected arguments: \"template_name\",\"interface_name\"," + "\"operation_name\",\"output_variable_name\"")); diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetProperty.java index 1abee6e..fca5f7f 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetProperty.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/functions/GetProperty.java @@ -1,18 +1,19 @@ -package org.openecomp.sdc.toscaparser.api.functions; +package org.onap.sdc.toscaparser.api.functions; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.*; +import org.onap.sdc.toscaparser.api.elements.CapabilityTypeDef; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.ArrayList; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.*; -import org.openecomp.sdc.toscaparser.api.elements.CapabilityTypeDef; -import org.openecomp.sdc.toscaparser.api.elements.EntityType; -import org.openecomp.sdc.toscaparser.api.elements.NodeType; -import org.openecomp.sdc.toscaparser.api.elements.PropertyDef; -import org.openecomp.sdc.toscaparser.api.elements.RelationshipType; -import org.openecomp.sdc.toscaparser.api.elements.StatefulEntityType; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.*; +import org.onap.sdc.toscaparser.api.elements.EntityType; +import org.onap.sdc.toscaparser.api.elements.NodeType; +import org.onap.sdc.toscaparser.api.elements.PropertyDef; +import org.onap.sdc.toscaparser.api.elements.RelationshipType; +import org.onap.sdc.toscaparser.api.elements.StatefulEntityType; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class GetProperty extends Function { // Get a property value of an entity defined in the same service template @@ -41,7 +42,7 @@ public class GetProperty extends Function { // * { get_property: [ SELF, database_endpoint, port, 1 ] } - public GetProperty(TopologyTemplate ttpl,Object context,String name,ArrayList<Object> args) { + public GetProperty(TopologyTemplate ttpl, Object context, String name, ArrayList<Object> args) { super(ttpl,context,name,args); } @@ -59,7 +60,7 @@ public class GetProperty extends Function { } Object prop = foundProp.getValue(); if(prop instanceof Function) { - Function.getFunction(toscaTpl,context, prop, toscaTpl.getResolveGetInput()); + getFunction(toscaTpl,context, prop, toscaTpl.getResolveGetInput()); } } else if(args.size() >= 3) { @@ -327,7 +328,7 @@ public class GetProperty extends Function { if(propertyValue instanceof Function) { return ((Function)propertyValue).result(); } - return Function.getFunction(toscaTpl,context,propertyValue, toscaTpl.getResolveGetInput()); + return getFunction(toscaTpl,context,propertyValue, toscaTpl.getResolveGetInput()); } public String getNodeTemplateName() { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Token.java b/src/main/java/org/onap/sdc/toscaparser/api/functions/Token.java index 8f35a80..771345b 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/Token.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/functions/Token.java @@ -1,11 +1,11 @@ -package org.openecomp.sdc.toscaparser.api.functions; +package org.onap.sdc.toscaparser.api.functions; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.TopologyTemplate; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.ArrayList; -import org.openecomp.sdc.toscaparser.api.TopologyTemplate; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class Token extends Function { // Validate the function and provide an instance of the function @@ -29,7 +29,7 @@ public class Token extends Function { // [ get_attribute: [ my_server, data_endpoint, ip_address ], ':', 1 ] - public Token(TopologyTemplate ttpl,Object context,String name,ArrayList<Object> args) { + public Token(TopologyTemplate ttpl, Object context, String name, ArrayList<Object> args) { super(ttpl,context,name,args); } diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java b/src/main/java/org/onap/sdc/toscaparser/api/parameters/Input.java index 15ca6da..7e83cfb 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Input.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/parameters/Input.java @@ -1,16 +1,16 @@ -package org.openecomp.sdc.toscaparser.api.parameters; +package org.onap.sdc.toscaparser.api.parameters; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.DataEntity; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.DataEntity; -import org.openecomp.sdc.toscaparser.api.elements.EntityType; -import org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint; -import org.openecomp.sdc.toscaparser.api.elements.constraints.Schema; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.elements.EntityType; +import org.onap.sdc.toscaparser.api.elements.constraints.Constraint; +import org.onap.sdc.toscaparser.api.elements.constraints.Schema; public class Input { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Output.java b/src/main/java/org/onap/sdc/toscaparser/api/parameters/Output.java index 381388b..093c6cf 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/parameters/Output.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/parameters/Output.java @@ -1,10 +1,10 @@ -package org.openecomp.sdc.toscaparser.api.parameters; +package org.onap.sdc.toscaparser.api.parameters; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.LinkedHashMap; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class Output { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java b/src/main/java/org/onap/sdc/toscaparser/api/prereq/CSAR.java index b64bd9a..98625e0 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/prereq/CSAR.java @@ -1,6 +1,9 @@ -package org.openecomp.sdc.toscaparser.api.prereq; +package org.onap.sdc.toscaparser.api.prereq; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.ImportsLoader; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.utils.UrlUtils; import java.io.BufferedOutputStream; import java.io.File; @@ -19,11 +22,8 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; -import org.openecomp.sdc.toscaparser.api.ImportsLoader; -import org.openecomp.sdc.toscaparser.api.common.JToscaException; -import org.openecomp.sdc.toscaparser.api.utils.JToscaErrorCodes; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; -import org.openecomp.sdc.toscaparser.api.utils.UrlUtils; +import org.onap.sdc.toscaparser.api.common.JToscaException; +import org.onap.sdc.toscaparser.api.utils.JToscaErrorCodes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; @@ -62,7 +62,7 @@ public class CSAR { if(isFile) { File f = new File(path); if (!f.isFile()) { - ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE220", String.format("\"%s\" is not a file", path))); + ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE220", String.format("\"%s\" is not a file", path))); return false; } else { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/CopyUtils.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/CopyUtils.java index db236e1..55e9ba1 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/CopyUtils.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/CopyUtils.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.utils; +package org.onap.sdc.toscaparser.api.utils; import java.util.ArrayList; import java.util.LinkedHashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/DumpUtils.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/DumpUtils.java index 32c69cd..f23e1c6 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/DumpUtils.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/DumpUtils.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.utils; +package org.onap.sdc.toscaparser.api.utils; import java.util.ArrayList; import java.util.LinkedHashMap; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/JToscaErrorCodes.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/JToscaErrorCodes.java index 6fb4606..3abd3b1 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/JToscaErrorCodes.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/JToscaErrorCodes.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api.utils; +package org.onap.sdc.toscaparser.api.utils; public enum JToscaErrorCodes { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/TOSCAVersionProperty.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/TOSCAVersionProperty.java index f749f7b..caba044 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/TOSCAVersionProperty.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/TOSCAVersionProperty.java @@ -1,6 +1,6 @@ -package org.openecomp.sdc.toscaparser.api.utils; +package org.onap.sdc.toscaparser.api.utils; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/ThreadLocalsHolder.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/ThreadLocalsHolder.java index 0e1531f..8a04c0d 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/ThreadLocalsHolder.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/ThreadLocalsHolder.java @@ -1,6 +1,6 @@ -package org.openecomp.sdc.toscaparser.api.utils; +package org.onap.sdc.toscaparser.api.utils; -import org.openecomp.sdc.toscaparser.api.common.ValidationIssueCollector; +import org.onap.sdc.toscaparser.api.common.ValidationIssueCollector; public class ThreadLocalsHolder { diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/UrlUtils.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/UrlUtils.java index 3383bd7..3eb156d 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/UrlUtils.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/UrlUtils.java @@ -1,6 +1,6 @@ -package org.openecomp.sdc.toscaparser.api.utils; +package org.onap.sdc.toscaparser.api.utils; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.io.IOException; import java.net.HttpURLConnection; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/ValidateUtils.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java index 53f5bec..6c26f18 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/utils/ValidateUtils.java +++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java @@ -1,6 +1,6 @@ -package org.openecomp.sdc.toscaparser.api.utils; +package org.onap.sdc.toscaparser.api.utils; -import org.openecomp.sdc.toscaparser.api.common.JToscaValidationIssue; +import org.onap.sdc.toscaparser.api.common.JToscaValidationIssue; import java.util.ArrayList; import java.util.Date; diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Schema.java.orig b/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Schema.java.orig deleted file mode 100644 index 355f505..0000000 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/elements/constraints/Schema.java.orig +++ /dev/null @@ -1,281 +0,0 @@ -package org.openecomp.sdc.toscaparser.api.elements.constraints; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -import org.openecomp.sdc.toscaparser.api.common.ValidationIssueCollector; - - -public class Schema { - - private static final String TYPE = "type"; - private static final String REQUIRED = "required"; - private static final String DESCRIPTION = "description"; - private static final String DEFAULT = "default"; - private static final String CONSTRAINTS = "constraints"; - private static final String STATUS = "status"; - private static final String ENTRYSCHEMA = "entry_schema"; - private static final String KEYS[] = { - TYPE, REQUIRED, DESCRIPTION,DEFAULT, CONSTRAINTS, ENTRYSCHEMA, STATUS}; - - public static final String INTEGER = "integer"; - public static final String STRING = "string"; - public static final String BOOLEAN = "boolean"; - public static final String FLOAT = "float"; - public static final String RANGE = "range"; - public static final String NUMBER = "number"; - public static final String TIMESTAMP = "timestamp"; - public static final String LIST = "list"; - public static final String MAP = "map"; - public static final String SCALAR_UNIT_SIZE = "scalar-unit.size"; - public static final String SCALAR_UNIT_FREQUENCY = "scalar-unit.frequency"; - public static final String SCALAR_UNIT_TIME = "scalar-unit.time"; - public static final String VERSION = "version"; - public static final String PORTDEF = "PortDef"; - public static final String PORTSPEC = "PortSpec"; //??? PortSpec.SHORTNAME -<<<<<<< HEAD - public static final String JSON = "json"; -======= - public static final String JSON = "json"; ->>>>>>> master - - public static final String PROPERTY_TYPES[] = { - INTEGER, STRING, BOOLEAN, FLOAT, RANGE,NUMBER, TIMESTAMP, LIST, MAP, - SCALAR_UNIT_SIZE, SCALAR_UNIT_FREQUENCY, SCALAR_UNIT_TIME, - VERSION, PORTDEF, PORTSPEC, JSON}; - - @SuppressWarnings("unused") - private static final String SCALAR_UNIT_SIZE_DEFAULT = "B"; - - private static Map<String,Long> SCALAR_UNIT_SIZE_DICT = new HashMap<>(); - static { - SCALAR_UNIT_SIZE_DICT.put("B", 1L); - SCALAR_UNIT_SIZE_DICT.put("KB", 1000L); - SCALAR_UNIT_SIZE_DICT.put("KIB", 1024L); - SCALAR_UNIT_SIZE_DICT.put("MB", 1000000L); - SCALAR_UNIT_SIZE_DICT.put("MIB", 1048576L); - SCALAR_UNIT_SIZE_DICT.put("GB", 1000000000L); - SCALAR_UNIT_SIZE_DICT.put("GIB", 1073741824L); - SCALAR_UNIT_SIZE_DICT.put("TB", 1000000000000L); - SCALAR_UNIT_SIZE_DICT.put("TIB", 1099511627776L); - } - - private String name; - private LinkedHashMap<String,Object> schema; - private int _len; - private ArrayList<Constraint> constraintsList; - - - public Schema(String _name,LinkedHashMap<String,Object> _schemaDict) { - name = _name; - - if(!(_schemaDict instanceof LinkedHashMap)) { - //msg = (_('Schema definition of "%(pname)s" must be a dict.') - // % dict(pname=name)) - ExceptionCollector.appendException(String.format( - "InvalidSchemaError: Schema definition of \"%s\" must be a dict",name)); - } - - if(_schemaDict.get("type") == null) { - //msg = (_('Schema definition of "%(pname)s" must have a "type" ' - // 'attribute.') % dict(pname=name)) - ExceptionCollector.appendException(String.format( - "InvalidSchemaError: Schema definition of \"%s\" must have a \"type\" attribute",name)); - } - - schema = _schemaDict; - _len = 0; //??? None - constraintsList = new ArrayList<>(); - } - - public String getType() { - return (String)schema.get(TYPE); - } - - public boolean isRequired() { - return (boolean)schema.getOrDefault(REQUIRED, true); - } - - public String getDescription() { - return (String)schema.getOrDefault(DESCRIPTION,""); - } - - public Object getDefault() { - return schema.get(DEFAULT); - } - - public String getStatus() { - return (String)schema.getOrDefault(STATUS,""); - } - - @SuppressWarnings("unchecked") - public ArrayList<Constraint> getConstraints() { - if(constraintsList.size() == 0) { - Object cob = schema.get(CONSTRAINTS); - if(cob instanceof ArrayList) { - ArrayList<Object> constraintSchemata = (ArrayList<Object>)cob; - for(Object ob: constraintSchemata) { - if(ob instanceof LinkedHashMap) { - for(String cClass: ((LinkedHashMap<String,Object>)ob).keySet()) { - Constraint c = Constraint.factory(cClass,name,getType(),ob); - if(c != null) { - constraintsList.add(c); - } - else { - // error - ExceptionCollector.appendException(String.format( - "UnknownFieldError: Constraint type \"%s\" for property \"%s\" is not supported", - cClass,name)); - } - break; - } - } - } - } - } - return constraintsList; - } - - @SuppressWarnings("unchecked") - public LinkedHashMap<String,Object> getEntrySchema() { - return (LinkedHashMap<String,Object>)schema.get(ENTRYSCHEMA); - } - - // Python intrinsic methods... - - // substitute for __getitem__ (aka self[key]) - public Object getItem(String key) { - return schema.get(key); - } - - /* - def __iter__(self): - for k in self.KEYS: - try: - self.schema[k] - except KeyError: - pass - else: - yield k - */ - - // substitute for __len__ (aka self.len()) - public int getLen() { - int len = 0; - for(String k: KEYS) { - if(schema.get(k) != null) { - len++; - } - _len = len; - } - return _len; - } - // getter - public LinkedHashMap<String,Object> getSchema() { - return schema; - } - -} - -/*python - -class Schema(collections.Mapping): - -KEYS = ( - TYPE, REQUIRED, DESCRIPTION, - DEFAULT, CONSTRAINTS, ENTRYSCHEMA, STATUS -) = ( - 'type', 'required', 'description', - 'default', 'constraints', 'entry_schema', 'status' -) - -PROPERTY_TYPES = ( - INTEGER, STRING, BOOLEAN, FLOAT, RANGE, - NUMBER, TIMESTAMP, LIST, MAP, - SCALAR_UNIT_SIZE, SCALAR_UNIT_FREQUENCY, SCALAR_UNIT_TIME, - VERSION, PORTDEF, PORTSPEC -) = ( - 'integer', 'string', 'boolean', 'float', 'range', - 'number', 'timestamp', 'list', 'map', - 'scalar-unit.size', 'scalar-unit.frequency', 'scalar-unit.time', - 'version', 'PortDef', PortSpec.SHORTNAME -) - -SCALAR_UNIT_SIZE_DEFAULT = 'B' -SCALAR_UNIT_SIZE_DICT = {'B': 1, 'KB': 1000, 'KIB': 1024, 'MB': 1000000, - 'MIB': 1048576, 'GB': 1000000000, - 'GIB': 1073741824, 'TB': 1000000000000, - 'TIB': 1099511627776} - -def __init__(self, name, schema_dict): - self.name = name - if not isinstance(schema_dict, collections.Mapping): - msg = (_('Schema definition of "%(pname)s" must be a dict.') - % dict(pname=name)) - ExceptionCollector.appendException(InvalidSchemaError(message=msg)) - - try: - schema_dict['type'] - except KeyError: - msg = (_('Schema definition of "%(pname)s" must have a "type" ' - 'attribute.') % dict(pname=name)) - ExceptionCollector.appendException(InvalidSchemaError(message=msg)) - - self.schema = schema_dict - self._len = None - self.constraints_list = [] - -@property -def type(self): - return self.schema[self.TYPE] - -@property -def required(self): - return self.schema.get(self.REQUIRED, True) - -@property -def description(self): - return self.schema.get(self.DESCRIPTION, '') - -@property -def default(self): - return self.schema.get(self.DEFAULT) - -@property -def status(self): - return self.schema.get(self.STATUS, '') - -@property -def constraints(self): - if not self.constraints_list: - constraint_schemata = self.schema.get(self.CONSTRAINTS) - if constraint_schemata: - self.constraints_list = [Constraint(self.name, - self.type, - cschema) - for cschema in constraint_schemata] - return self.constraints_list - -@property -def entry_schema(self): - return self.schema.get(self.ENTRYSCHEMA) - -def __getitem__(self, key): - return self.schema[key] - -def __iter__(self): - for k in self.KEYS: - try: - self.schema[k] - except KeyError: - pass - else: - yield k - -def __len__(self): - if self._len is None: - self._len = len(list(iter(self))) - return self._len -*/
\ No newline at end of file diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java.orig b/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java.orig deleted file mode 100644 index b4d2614..0000000 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java.orig +++ /dev/null @@ -1,767 +0,0 @@ -package org.openecomp.sdc.toscaparser.api.prereq; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.RandomAccessFile; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.util.*; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; -import java.util.zip.ZipInputStream; - -import org.openecomp.sdc.toscaparser.api.ImportsLoader; -import org.openecomp.sdc.toscaparser.api.common.ValidationIssueCollector; -import org.openecomp.sdc.toscaparser.api.elements.Metadata; -import org.openecomp.sdc.toscaparser.api.utils.UrlUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.yaml.snakeyaml.Yaml; - -<<<<<<< HEAD:jtosca/src/main/java/org/openecomp/sdc/toscaparser/prereq/CSAR.java -import org.openecomp.sdc.toscaparser.ImportsLoader; -import org.openecomp.sdc.toscaparser.common.ExceptionCollector; -import org.openecomp.sdc.toscaparser.utils.UrlUtils; - -======= ->>>>>>> 243072-jtosca-package-fix:jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java -public class CSAR { - - private static Logger log = LoggerFactory.getLogger(CSAR.class.getName()); - private static final ArrayList<String> META_PROPERTIES_FILES = new ArrayList<>(Arrays.asList("TOSCA-Metadata/TOSCA.meta", "csar.meta")); - - private String path; - private boolean isFile; - private boolean isValidated; - private boolean errorCaught; - private String csar; - private String tempDir; -// private Metadata metaData; - private File tempFile; - private LinkedHashMap<String, LinkedHashMap<String, Object>> metaProperties; - - public CSAR(String csarPath, boolean aFile) { - path = csarPath; - isFile = aFile; - isValidated = false; - errorCaught = false; - csar = null; - tempDir = null; - tempFile = null; - metaProperties = new LinkedHashMap<>(); - } - - @SuppressWarnings("unchecked") - public boolean validate() { - isValidated = true; - - //validate that the file or URL exists - - if(isFile) { - File f = new File(path); - if (!f.isFile()) { - ExceptionCollector.appendException(String.format("\"%s\" is not a file", path)); - return false; - } - else { - this.csar = path; - } - } - else { - if(!UrlUtils.validateUrl(path)) { - ExceptionCollector.appendException(String.format("ImportError: \"%s\" does not exist",path)); - return false; - } - // get it to a local file - try { - File tempFile = File.createTempFile("csartmp",".csar"); - Path ptf = Paths.get(tempFile.getPath()); - URL webfile = new URL(path); - InputStream in = webfile.openStream(); - Files.copy(in,ptf,StandardCopyOption.REPLACE_EXISTING); - } - catch(Exception e) { - ExceptionCollector.appendException("ImportError: failed to load CSAR from " + path); - return false; - } - - log.debug("CSAR - validate - currently only files are supported"); - return false; - } - - _parseAndValidateMetaProperties(); - - if(errorCaught) { - return false; - } - - // validate that external references in the main template actually exist and are accessible - _validateExternalReferences(); - - return !errorCaught; - - } - - private void _parseAndValidateMetaProperties() { - - ZipFile zf = null; - - try { - - // validate that it is a valid zip file - RandomAccessFile raf = new RandomAccessFile(csar, "r"); - long n = raf.readInt(); - raf.close(); - // check if Zip's magic number - if (n != 0x504B0304) { - throw new IOException(String.format("\"%s\" is not a valid zip file", csar)); - } - - // validate that it contains the metadata file in the correct location - zf = new ZipFile(csar); - ZipEntry ze = zf.getEntry("TOSCA-Metadata/TOSCA.meta"); - if (ze == null) { - throw new IOException(String.format( - "\"%s\" is not a valid CSAR as it does not contain the " + - "required file \"TOSCA.meta\" in the folder \"TOSCA-Metadata\"", csar)); - } - - //Going over expected metadata files and parsing them - for (String metaFile: META_PROPERTIES_FILES) { - - byte ba[] = new byte[4096]; - ze = zf.getEntry(metaFile); - if (ze != null) { - InputStream inputStream = zf.getInputStream(ze); - n = inputStream.read(ba, 0, 4096); - - String md = new String(ba); - md = md.substring(0, (int) n); - Yaml yaml = new Yaml(); - Object mdo = yaml.load(md); - if (!(mdo instanceof LinkedHashMap)) { - throw new IOException(String.format( - "The file \"%s\" in the" + - " CSAR \"%s\" does not contain valid YAML content", ze.getName(), csar)); - } - - String[] split = ze.getName().split("/"); - String fileName = split[split.length - 1]; - - if (!metaProperties.containsKey(fileName)) { - metaProperties.put(fileName, (LinkedHashMap<String, Object>) mdo); - } - } - } - - // verify it has "Entry-Definition" - String edf = _getMetadata("Entry-Definitions"); - if (edf == null) { - throw new IOException(String.format( - "The CSAR \"%s\" is missing the required metadata " + - "\"Entry-Definitions\" in \"TOSCA-Metadata/TOSCA.meta\"", csar)); - } - - //validate that "Entry-Definitions' metadata value points to an existing file in the CSAR - boolean foundEDF = false; - Enumeration<? extends ZipEntry> entries = zf.entries(); - while (entries.hasMoreElements()) { - ze = entries.nextElement(); - if (ze.getName().equals(edf)) { - foundEDF = true; - break; - } - } - if (!foundEDF) { - throw new IOException(String.format( - "The \"Entry-Definitions\" file defined in the CSAR \"%s\" does not exist", csar)); - } - } catch (Exception e) { - ExceptionCollector.appendException("ValidationError: " + e.getMessage()); - errorCaught = true; - } - - try { - if (zf != null) { - zf.close(); - } - } catch (IOException e) { - } - } - - public void cleanup() { - try { - if(tempFile != null) { - tempFile.delete(); - } - } - catch(Exception e) { - } - } - - private String _getMetadata(String key) { - if(!isValidated) { - validate(); - } - Object value = _getMetaProperty("TOSCA.meta").get(key); - return value != null ? value.toString() : null; - } - - public String getAuthor() { - return _getMetadata("Created-By"); - } - - public String getVersion() { - return _getMetadata("CSAR-Version"); - } - - public LinkedHashMap<String, LinkedHashMap<String, Object>> getMetaProperties() { - return metaProperties; - } - - private LinkedHashMap<String, Object> _getMetaProperty(String propertiesFile) { - return metaProperties.get(propertiesFile); - } - - public String getMainTemplate() { - String entryDef = _getMetadata("Entry-Definitions"); - ZipFile zf; - boolean ok = false; - try { - zf = new ZipFile(path); - ok = (zf.getEntry(entryDef) != null); - zf.close(); - } - catch(IOException e) { - if(!ok) { - log.error("CSAR - getMainTemplate - failed to open {}", path); - } - } - if(ok) { - return entryDef; - } - else { - return null; - } - } - - @SuppressWarnings("unchecked") - public LinkedHashMap<String,Object> getMainTemplateYaml() { - String mainTemplate = tempDir + File.separator + getMainTemplate(); - if(mainTemplate != null) { - try { - InputStream input = new FileInputStream(new File(mainTemplate)); - Yaml yaml = new Yaml(); - Object data = yaml.load(input); - if(!(data instanceof LinkedHashMap)) { - throw new IOException(); - } - return (LinkedHashMap<String,Object>)data; - } - catch(Exception e) { - ExceptionCollector.appendException(String.format( - "The file \"%s\" in the CSAR \"%s\" does not " + - "contain valid TOSCA YAML content", - mainTemplate,csar)); - } - } - return null; - } - - public String getDescription() { - String desc = _getMetadata("Description"); - if(desc != null) { - return desc; - } - - Map<String, Object> metaData = metaProperties.get("TOSCA.meta"); - metaData.put("Description", getMainTemplateYaml().get("description")); - return _getMetadata("Description"); - } - - public String getTempDir() { - return tempDir; - } - - public void decompress() throws IOException { - if(!isValidated) { - validate(); - } - tempDir = Files.createTempDirectory("JTP").toString(); - unzip(path,tempDir); - - } - - private void _validateExternalReferences() { - // Extracts files referenced in the main template - // These references are currently supported: - // * imports - // * interface implementations - // * artifacts - try { - decompress(); - String mainTplFile = getMainTemplate(); - if(mainTplFile == null) { - return; - } - - LinkedHashMap<String,Object> mainTpl = getMainTemplateYaml(); - if(mainTpl.get("imports") != null) { - // this loads the imports - ImportsLoader il = new ImportsLoader((ArrayList<Object>)mainTpl.get("imports"), - tempDir + File.separator + mainTplFile, - (Object)null, - (LinkedHashMap<String,Object>)null); - } - - if(mainTpl.get("topology_template") != null) { - LinkedHashMap<String,Object> topologyTemplate = - (LinkedHashMap<String,Object>)mainTpl.get("topology_template"); - - if(topologyTemplate.get("node_templates") != null) { - LinkedHashMap<String,Object> nodeTemplates = - (LinkedHashMap<String,Object>)topologyTemplate.get("node_templates"); - for(String nodeTemplateKey: nodeTemplates.keySet()) { - LinkedHashMap<String,Object> nodeTemplate = - (LinkedHashMap<String,Object>)nodeTemplates.get(nodeTemplateKey); - if(nodeTemplate.get("artifacts") != null) { - LinkedHashMap<String,Object> artifacts = - (LinkedHashMap<String,Object>)nodeTemplate.get("artifacts"); - for(String artifactKey: artifacts.keySet()) { - Object artifact = artifacts.get(artifactKey); - if(artifact instanceof String) { - _validateExternalReference(mainTplFile,(String)artifact,true); - } - else if(artifact instanceof LinkedHashMap) { - String file = (String)((LinkedHashMap<String,Object>)artifact).get("file"); - if(file != null) { - _validateExternalReference(mainTplFile,file,true); - } - } - else { - ExceptionCollector.appendException(String.format( - "ValueError: Unexpected artifact definition for \"%s\"", - artifactKey)); - errorCaught = true; - } - } - } - if(nodeTemplate.get("interfaces") != null) { - LinkedHashMap<String,Object> interfaces = - (LinkedHashMap<String,Object>)nodeTemplate.get("interfaces"); - for(String interfaceKey: interfaces.keySet()) { - LinkedHashMap<String,Object> _interface = - (LinkedHashMap<String,Object>)interfaces.get(interfaceKey); - for(String operationKey: _interface.keySet()) { - Object operation = _interface.get(operationKey); - if(operation instanceof String) { - _validateExternalReference(mainTplFile,(String)operation,false); - } - else if(operation instanceof LinkedHashMap) { - String imp = (String)((LinkedHashMap<String,Object>)operation).get("implementation"); - if(imp != null) { - _validateExternalReference(mainTplFile,imp,true); - } - } - } - } - } - } - } - } - } - catch(IOException e) { - errorCaught = true; - } - finally { - // delete tempDir (only here?!?) - File fdir = new File(tempDir); - deleteDir(fdir); - tempDir = null; - } - } - - public static void deleteDir(File fdir) { - try { - if (fdir.isDirectory()) { - for (File c : fdir.listFiles()) - deleteDir(c); - } - fdir.delete(); - } - catch(Exception e) { - } - } - - private void _validateExternalReference(String tplFile,String resourceFile,boolean raiseExc) { - // Verify that the external resource exists - - // If resource_file is a URL verify that the URL is valid. - // If resource_file is a relative path verify that the path is valid - // considering base folder (self.temp_dir) and tpl_file. - // Note that in a CSAR resource_file cannot be an absolute path. - if(UrlUtils.validateUrl(resourceFile)) { - String msg = String.format("URLException: The resource at \"%s\" cannot be accessed",resourceFile); - try { - if(UrlUtils.isUrlAccessible(resourceFile)) { - return; - } - else { - ExceptionCollector.appendException(msg); - errorCaught = true; - } - } - catch (Exception e) { - ExceptionCollector.appendException(msg); - } - } - - String dirPath = Paths.get(tplFile).getParent().toString(); - String filePath = tempDir + File.separator + dirPath + File.separator + resourceFile; - File f = new File(filePath); - if(f.isFile()) { - return; - } - - if(raiseExc) { - ExceptionCollector.appendException(String.format( - "ValueError: The resource \"%s\" does not exist",resourceFile)); - } - errorCaught = true; - } - - private void unzip(String zipFilePath, String destDirectory) throws IOException { - File destDir = new File(destDirectory); - if (!destDir.exists()) { - destDir.mkdir(); - } - ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath)); - ZipEntry entry = zipIn.getNextEntry(); - // iterates over entries in the zip file - while (entry != null) { - // create all directories needed for nested items - String[] parts = entry.getName().split("/"); - String s = destDirectory + File.separator ; - for(int i=0; i< parts.length-1; i++) { - s += parts[i]; - File idir = new File(s); - if(!idir.exists()) { - idir.mkdir(); - } - s += File.separator; - } - String filePath = destDirectory + File.separator + entry.getName(); - if (!entry.isDirectory()) { - // if the entry is a file, extracts it - extractFile(zipIn, filePath); - } else { - // if the entry is a directory, make the directory - File dir = new File(filePath); - dir.mkdir(); - } - zipIn.closeEntry(); - entry = zipIn.getNextEntry(); - } - zipIn.close(); - } - - /** - * Extracts a zip entry (file entry) - * @param zipIn - * @param filePath - * @throws IOException - */ - private static final int BUFFER_SIZE = 4096; - - private void extractFile(ZipInputStream zipIn, String filePath) throws IOException { - //BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath)); - FileOutputStream fos = new FileOutputStream(filePath); - BufferedOutputStream bos = new BufferedOutputStream(fos); - byte[] bytesIn = new byte[BUFFER_SIZE]; - int read = 0; - while ((read = zipIn.read(bytesIn)) != -1) { - bos.write(bytesIn, 0, read); - } - bos.close(); - } - -} - -/*python - -from toscaparser.common.exception import ExceptionCollector -from toscaparser.common.exception import URLException -from toscaparser.common.exception import ValidationError -from toscaparser.imports import ImportsLoader -from toscaparser.utils.gettextutils import _ -from toscaparser.utils.urlutils import UrlUtils - -try: # Python 2.x - from BytesIO import BytesIO -except ImportError: # Python 3.x - from io import BytesIO - - -class CSAR(object): - - def __init__(self, csar_file, a_file=True): - self.path = csar_file - self.a_file = a_file - self.is_validated = False - self.error_caught = False - self.csar = None - self.temp_dir = None - - def validate(self): - """Validate the provided CSAR file.""" - - self.is_validated = True - - # validate that the file or URL exists - missing_err_msg = (_('"%s" does not exist.') % self.path) - if self.a_file: - if not os.path.isfile(self.path): - ExceptionCollector.appendException( - ValidationError(message=missing_err_msg)) - return False - else: - self.csar = self.path - else: # a URL - if not UrlUtils.validate_url(self.path): - ExceptionCollector.appendException( - ValidationError(message=missing_err_msg)) - return False - else: - response = requests.get(self.path) - self.csar = BytesIO(response.content) - - # validate that it is a valid zip file - if not zipfile.is_zipfile(self.csar): - err_msg = (_('"%s" is not a valid zip file.') % self.path) - ExceptionCollector.appendException( - ValidationError(message=err_msg)) - return False - - # validate that it contains the metadata file in the correct location - self.zfile = zipfile.ZipFile(self.csar, 'r') - filelist = self.zfile.namelist() - if 'TOSCA-Metadata/TOSCA.meta' not in filelist: - err_msg = (_('"%s" is not a valid CSAR as it does not contain the ' - 'required file "TOSCA.meta" in the folder ' - '"TOSCA-Metadata".') % self.path) - ExceptionCollector.appendException( - ValidationError(message=err_msg)) - return False - - # validate that 'Entry-Definitions' property exists in TOSCA.meta - data = self.zfile.read('TOSCA-Metadata/TOSCA.meta') - invalid_yaml_err_msg = (_('The file "TOSCA-Metadata/TOSCA.meta" in ' - 'the CSAR "%s" does not contain valid YAML ' - 'content.') % self.path) - try: - meta = yaml.load(data) - if type(meta) is dict: - self.metadata = meta - else: - ExceptionCollector.appendException( - ValidationError(message=invalid_yaml_err_msg)) - return False - except yaml.YAMLError: - ExceptionCollector.appendException( - ValidationError(message=invalid_yaml_err_msg)) - return False - - if 'Entry-Definitions' not in self.metadata: - err_msg = (_('The CSAR "%s" is missing the required metadata ' - '"Entry-Definitions" in ' - '"TOSCA-Metadata/TOSCA.meta".') - % self.path) - ExceptionCollector.appendException( - ValidationError(message=err_msg)) - return False - - # validate that 'Entry-Definitions' metadata value points to an - # existing file in the CSAR - entry = self.metadata.get('Entry-Definitions') - if entry and entry not in filelist: - err_msg = (_('The "Entry-Definitions" file defined in the ' - 'CSAR "%s" does not exist.') % self.path) - ExceptionCollector.appendException( - ValidationError(message=err_msg)) - return False - - # validate that external references in the main template actually - # exist and are accessible - self._validate_external_references() - return not self.error_caught - - def get_metadata(self): - """Return the metadata dictionary.""" - - # validate the csar if not already validated - if not self.is_validated: - self.validate() - - # return a copy to avoid changes overwrite the original - return dict(self.metadata) if self.metadata else None - - def _get_metadata(self, key): - if not self.is_validated: - self.validate() - return self.metadata.get(key) - - def get_author(self): - return self._get_metadata('Created-By') - - def get_version(self): - return self._get_metadata('CSAR-Version') - - def get_main_template(self): - entry_def = self._get_metadata('Entry-Definitions') - if entry_def in self.zfile.namelist(): - return entry_def - - def get_main_template_yaml(self): - main_template = self.get_main_template() - if main_template: - data = self.zfile.read(main_template) - invalid_tosca_yaml_err_msg = ( - _('The file "%(template)s" in the CSAR "%(csar)s" does not ' - 'contain valid TOSCA YAML content.') % - {'template': main_template, 'csar': self.path}) - try: - tosca_yaml = yaml.load(data) - if type(tosca_yaml) is not dict: - ExceptionCollector.appendException( - ValidationError(message=invalid_tosca_yaml_err_msg)) - return tosca_yaml - except Exception: - ExceptionCollector.appendException( - ValidationError(message=invalid_tosca_yaml_err_msg)) - - def get_description(self): - desc = self._get_metadata('Description') - if desc is not None: - return desc - - self.metadata['Description'] = \ - self.get_main_template_yaml().get('description') - return self.metadata['Description'] - - def decompress(self): - if not self.is_validated: - self.validate() - self.temp_dir = tempfile.NamedTemporaryFile().name - with zipfile.ZipFile(self.csar, "r") as zf: - zf.extractall(self.temp_dir) - - def _validate_external_references(self): - """Extracts files referenced in the main template - - These references are currently supported: - * imports - * interface implementations - * artifacts - """ - try: - self.decompress() - main_tpl_file = self.get_main_template() - if not main_tpl_file: - return - main_tpl = self.get_main_template_yaml() - - if 'imports' in main_tpl: - ImportsLoader(main_tpl['imports'], - os.path.join(self.temp_dir, main_tpl_file)) - - if 'topology_template' in main_tpl: - topology_template = main_tpl['topology_template'] - - if 'node_templates' in topology_template: - node_templates = topology_template['node_templates'] - - for node_template_key in node_templates: - node_template = node_templates[node_template_key] - if 'artifacts' in node_template: - artifacts = node_template['artifacts'] - for artifact_key in artifacts: - artifact = artifacts[artifact_key] - if isinstance(artifact, six.string_types): - self._validate_external_reference( - main_tpl_file, - artifact) - elif isinstance(artifact, dict): - if 'file' in artifact: - self._validate_external_reference( - main_tpl_file, - artifact['file']) - else: - ExceptionCollector.appendException( - ValueError(_('Unexpected artifact ' - 'definition for "%s".') - % artifact_key)) - self.error_caught = True - if 'interfaces' in node_template: - interfaces = node_template['interfaces'] - for interface_key in interfaces: - interface = interfaces[interface_key] - for opertation_key in interface: - operation = interface[opertation_key] - if isinstance(operation, six.string_types): - self._validate_external_reference( - main_tpl_file, - operation, - False) - elif isinstance(operation, dict): - if 'implementation' in operation: - self._validate_external_reference( - main_tpl_file, - operation['implementation']) - finally: - if self.temp_dir: - shutil.rmtree(self.temp_dir) - - def _validate_external_reference(self, tpl_file, resource_file, - raise_exc=True): - """Verify that the external resource exists - - If resource_file is a URL verify that the URL is valid. - If resource_file is a relative path verify that the path is valid - considering base folder (self.temp_dir) and tpl_file. - Note that in a CSAR resource_file cannot be an absolute path. - """ - if UrlUtils.validate_url(resource_file): - msg = (_('The resource at "%s" cannot be accessed.') % - resource_file) - try: - if UrlUtils.url_accessible(resource_file): - return - else: - ExceptionCollector.appendException( - URLException(what=msg)) - self.error_caught = True - except Exception: - ExceptionCollector.appendException( - URLException(what=msg)) - self.error_caught = True - - if os.path.isfile(os.path.join(self.temp_dir, - os.path.dirname(tpl_file), - resource_file)): - return - - if raise_exc: - ExceptionCollector.appendException( - ValueError(_('The resource "%s" does not exist.') - % resource_file)) - self.error_caught = True -*/ - - diff --git a/src/test/java/org/openecomp/sdc/toscaparser/api/GetValidationIssues.java b/src/test/java/org/onap/sdc/toscaparser/api/GetValidationIssues.java index 7a0eec1..a5afa6b 100644 --- a/src/test/java/org/openecomp/sdc/toscaparser/api/GetValidationIssues.java +++ b/src/test/java/org/onap/sdc/toscaparser/api/GetValidationIssues.java @@ -1,14 +1,12 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import com.opencsv.CSVWriter; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.Date; import java.util.List; import java.util.Scanner; //Generate excel file, include all validation issues errors in jtosca @@ -20,7 +18,7 @@ public class GetValidationIssues { public static void main(String[] args) { System.out.println("GetAllValidationIssues - path to project files Directory is " + Arrays.toString(args)); - File jtoscaFiles = new File(args[0]+ "\\jtosca\\src\\main\\java\\org\\openecomp\\sdc\\toscaparser\\api"); + File jtoscaFiles = new File(args[0]+ "\\jtosca\\src\\main\\java\\org\\onap\\sdc\\toscaparser\\api"); try { printFiles(jtoscaFiles); diff --git a/src/test/java/org/openecomp/sdc/toscaparser/api/JToscaImportTest.java b/src/test/java/org/onap/sdc/toscaparser/api/JToscaImportTest.java index c8a30fa..589e47c 100644 --- a/src/test/java/org/openecomp/sdc/toscaparser/api/JToscaImportTest.java +++ b/src/test/java/org/onap/sdc/toscaparser/api/JToscaImportTest.java @@ -1,8 +1,8 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import org.junit.Test; -import org.openecomp.sdc.toscaparser.api.common.JToscaException; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaException; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; import java.io.File; import java.util.ArrayList; diff --git a/src/test/java/org/openecomp/sdc/toscaparser/api/JToscaMetadataParse.java b/src/test/java/org/onap/sdc/toscaparser/api/JToscaMetadataParse.java index 8f55fa4..37c6d18 100644 --- a/src/test/java/org/openecomp/sdc/toscaparser/api/JToscaMetadataParse.java +++ b/src/test/java/org/onap/sdc/toscaparser/api/JToscaMetadataParse.java @@ -1,4 +1,4 @@ -package org.openecomp.sdc.toscaparser.api; +package org.onap.sdc.toscaparser.api; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -8,9 +8,9 @@ import java.io.File; import java.util.LinkedHashMap; import org.junit.Test; -import org.openecomp.sdc.toscaparser.api.common.JToscaException; -import org.openecomp.sdc.toscaparser.api.utils.JToscaErrorCodes; -import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; +import org.onap.sdc.toscaparser.api.common.JToscaException; +import org.onap.sdc.toscaparser.api.utils.JToscaErrorCodes; +import org.onap.sdc.toscaparser.api.utils.ThreadLocalsHolder; public class JToscaMetadataParse { diff --git a/src/test/java/org/openecomp/sdc/toscaparser/api/elements/EntityTypeTest.java b/src/test/java/org/onap/sdc/toscaparser/api/elements/EntityTypeTest.java index 8e74e99..2a88c2b 100644 --- a/src/test/java/org/openecomp/sdc/toscaparser/api/elements/EntityTypeTest.java +++ b/src/test/java/org/onap/sdc/toscaparser/api/elements/EntityTypeTest.java @@ -1,7 +1,6 @@ -package org.openecomp.sdc.toscaparser.api.elements; +package org.onap.sdc.toscaparser.api.elements; import org.junit.After; -import org.junit.Before; import org.junit.Test; import java.util.HashMap; |