summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java/org/onap/cps/spi
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src/main/java/org/onap/cps/spi')
-rwxr-xr-xcps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java4
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/model/DataNode.java4
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/model/ExtendedModuleReference.java42
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java16
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/model/SchemaSet.java4
5 files changed, 23 insertions, 47 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
index 4306df78da..0e90e84f1e 100755
--- a/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
@@ -100,9 +100,11 @@ public interface CpsModulePersistenceService {
/**
* Identify new module references from those returned by a node compared to what is in CPS already.
+ * The system will ignore the namespace of all module references.
*
* @param moduleReferencesToCheck the module references ot check
- * @returns Collection of {@link ModuleReference} of previously unknown module references
+ * @returns Collection of {@link ModuleReference} (namespace will be always blank)
+ *
*/
Collection<ModuleReference> identifyNewModuleReferences(
Collection<ModuleReference> moduleReferencesToCheck);
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/DataNode.java b/cps-service/src/main/java/org/onap/cps/spi/model/DataNode.java
index 8e9dff873a..55e7b9970b 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/model/DataNode.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/model/DataNode.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2020-2021 Nordix Foundation.
+ * Copyright (C) 2020-2022 Nordix Foundation.
* Modifications Copyright (C) 2021 Bell Canada.
* Modifications Copyright (C) 2021 Pantheon.tech
* ================================================================================
@@ -38,7 +38,7 @@ public class DataNode {
private String dataspace;
private String schemaSetName;
private String anchorName;
- private ExtendedModuleReference extendedModuleReference;
+ private ModuleReference moduleReference;
private String xpath;
private Map<String, Object> leaves = Collections.emptyMap();
private Collection<String> xpathsChildren;
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/ExtendedModuleReference.java b/cps-service/src/main/java/org/onap/cps/spi/model/ExtendedModuleReference.java
deleted file mode 100644
index 5e9c8d0cd7..0000000000
--- a/cps-service/src/main/java/org/onap/cps/spi/model/ExtendedModuleReference.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation.
- * Modifications Copyright 2020-2021 Pantheon.tech
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.cps.spi.model;
-
-import java.io.Serializable;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class ExtendedModuleReference implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private String name;
- private String namespace;
- private String revision;
-
-}
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java b/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java
index 9b73f8ff0f..569f0a06ed 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/model/ModuleReference.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
+ * Copyright (C) 2021-2022 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,4 +35,18 @@ public class ModuleReference implements Serializable {
private static final long serialVersionUID = -1761408847591042599L;
private String moduleName;
private String revision;
+ @Builder.Default
+ private String namespace = "";
+
+ /**
+ * Constructor for module references without namespace (will remain blank).
+ *
+ * @param moduleName module names.
+ * @param revision revision of module.
+ */
+ public ModuleReference(final String moduleName, final String revision) {
+ this.moduleName = moduleName;
+ this.revision = revision;
+ this.namespace = "";
+ }
}
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/SchemaSet.java b/cps-service/src/main/java/org/onap/cps/spi/model/SchemaSet.java
index 4df7893e2c..bb981482f4 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/model/SchemaSet.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/model/SchemaSet.java
@@ -1,12 +1,14 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Pantheon.tech
+ * Modifications Copyright (C) 2022 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,5 +37,5 @@ public class SchemaSet implements Serializable {
private static final long serialVersionUID = 1464791260718603291L;
private String name;
private String dataspaceName;
- private List<ExtendedModuleReference> extendedModuleReferences;
+ private List<ModuleReference> moduleReferences;
}