+ /**
+ * Gets the Resource type from the given node type name.
+ *
+ * @param nodeTypeFullName - Node type Name
+ * @return Resource Type name
+ */
+ private String getResourceType(final String nodeTypeFullName) {
+
+ final Optional<String> nodeTypeNamePrefix = getNodeTypeNamePrefix(nodeTypeFullName);
+ if (nodeTypeNamePrefix.isPresent()) {
+ final String nameWithouNamespacePrefix = nodeTypeFullName.substring(nodeTypeNamePrefix.get().length());
+ final String[] findTypes = nameWithouNamespacePrefix.split("\\.");
+ if (findTypes.length > 0) {
+ final ResourceTypeEnum resourceType = ResourceTypeEnum.getType(findTypes[0].toUpperCase());
+ if (resourceType != null) {
+ return resourceType.name();
+ }
+ }
+ }
+ return ResourceTypeEnum.VFC.name();
+ }
+
+ /**
+ * Extracts the Node Type Name prefix from the given Node Type Name.
+ * @param nodeName - Node Type Name
+ * @return Node Type Name prefix
+ */
+ private Optional<String> getNodeTypeNamePrefix(final String nodeName) {
+ final List<String> definedNodeTypeNamespaceList = ConfigurationManager.getConfigurationManager()
+ .getConfiguration().getDefinedResourceNamespace();
+ for (final String validNamespace : definedNodeTypeNamespaceList) {
+ if (nodeName.startsWith(validNamespace)) {
+ return Optional.of(validNamespace);
+ }
+ }
+ return Optional.empty();
+ }
+
+ protected void validatePayloadNameSpace(final Wrapper<Response> responseWrapper,
+ final UploadResourceInfo resourceInfo,
+ final User user, final String toscaPayload) {