summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java3
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NSSI.java60
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/NewNsst.java2
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIObjectType.java2
-rw-r--r--common/src/main/java/org/onap/so/client/dmaap/DmaapConsumer.java24
5 files changed, 75 insertions, 16 deletions
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java
index c124bfa944..d720399293 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/EsrInfo.java
@@ -21,9 +21,10 @@
package org.onap.so.beans.nsmf;
import com.fasterxml.jackson.annotation.JsonInclude;
+import java.io.Serializable;
@JsonInclude(JsonInclude.Include.NON_NULL)
-public class EsrInfo {
+public class EsrInfo implements Serializable {
private String vendor;
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NSSI.java b/common/src/main/java/org/onap/so/beans/nsmf/NSSI.java
new file mode 100644
index 0000000000..a57458f2cf
--- /dev/null
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NSSI.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ # Copyright (c) 2019, CMCC Technologies Co., Ltd.
+ #
+ # 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.beans.nsmf;
+
+public class NSSI {
+
+ private String nssiId;
+
+ private String modelInvariantId;
+
+ private String modelVersionId;
+
+ public NSSI(String nssiId, String modelInvariantId, String modelVersionId) {
+ this.nssiId = nssiId;
+ this.modelInvariantId = modelInvariantId;
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getNssiId() {
+ return nssiId;
+ }
+
+ public void setNssiId(String nssiId) {
+ this.nssiId = nssiId;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NewNsst.java b/common/src/main/java/org/onap/so/beans/nsmf/NewNsst.java
index e13aa5000a..68aebf2df2 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/NewNsst.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/NewNsst.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
- * Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
index b96df4ff9e..7de60181a6 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
@@ -164,6 +164,8 @@ public class AAIObjectType implements GraphInventoryObjectType, Serializable {
new AAIObjectType(AAIObjectType.SERVICE_INSTANCE.uriTemplate(), "/slice-profiles", "sliceProfiles");
public static final AAIObjectType COMMUNICATION_PROFILE_ALL = new AAIObjectType(
AAIObjectType.SERVICE_INSTANCE.uriTemplate(), "/communication-service-profiles", "communicationProfiles");
+ public static final AAIObjectType QUERY_ALLOTTED_RESOURCE =
+ new AAIObjectType(AAIObjectType.SERVICE_INSTANCE.uriTemplate(), "?depth=2", "service-Instance");
private final String uriTemplate;
private final String parentUri;
diff --git a/common/src/main/java/org/onap/so/client/dmaap/DmaapConsumer.java b/common/src/main/java/org/onap/so/client/dmaap/DmaapConsumer.java
index 4de546e9da..cbad59e968 100644
--- a/common/src/main/java/org/onap/so/client/dmaap/DmaapConsumer.java
+++ b/common/src/main/java/org/onap/so/client/dmaap/DmaapConsumer.java
@@ -20,12 +20,12 @@
package org.onap.so.client.dmaap;
-import com.google.common.base.Stopwatch;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.onap.so.client.dmaap.exceptions.DMaaPConsumerFailure;
import org.onap.so.client.dmaap.exceptions.ExceededMaximumPollingTime;
import org.onap.so.client.dmaap.rest.RestConsumer;
+import com.google.common.base.Stopwatch;
public abstract class DmaapConsumer extends DmaapClient {
static final int MAX_ELAPSED_TIME = 180000;
@@ -40,7 +40,6 @@ public abstract class DmaapConsumer extends DmaapClient {
public boolean consume() throws Exception {
Consumer mrConsumer = this.getConsumer();
- boolean accepted = false;
Stopwatch stopwatch = Stopwatch.createUnstarted();
try {
while (this.continuePolling()) {
@@ -54,20 +53,17 @@ public abstract class DmaapConsumer extends DmaapClient {
Iterable<String> itr = mrConsumer.fetch();
stopwatch.stop();
for (String message : itr) {
- if (!accepted && this.isAccepted(message)) {
+ if (this.isAccepted(message)) {
logger.info("accepted message found for " + this.getRequestId() + " on " + this.getTopic());
- accepted = true;
}
- if (accepted) {
- logger.info("received dmaap message: " + message);
- if (this.isFailure(message)) {
- this.stopProcessingMessages();
- final String errorMsg = "failure received from dmaap topic " + this.getTopic();
- logger.error(errorMsg);
- throw new DMaaPConsumerFailure(errorMsg);
- } else {
- this.processMessage(message);
- }
+ logger.info("received dmaap message: " + message);
+ if (this.isFailure(message)) {
+ this.stopProcessingMessages();
+ final String errorMsg = "failure received from dmaap topic " + this.getTopic();
+ logger.error(errorMsg);
+ throw new DMaaPConsumerFailure(errorMsg);
+ } else {
+ this.processMessage(message);
}
}
}