From bcfee1b5b7bd91f21a6b7b2fd3be9484b10b542c Mon Sep 17 00:00:00 2001 From: hetengjiao Date: Mon, 18 Jan 2021 09:16:38 +0800 Subject: update nsmf workflow of active and deactive nssi Issue-ID: SO-2963 Signed-off-by: hetengjiao Change-Id: Ic144713f9cf55ed8db679bd7c57052fcea2aadf9 --- .../java/org/onap/so/beans/nsmf/ActDeActNssi.java | 5 +- .../java/org/onap/so/beans/nsmf/CustomerInfo.java | 45 ++++++++++++++++ .../src/main/java/org/onap/so/beans/nsmf/NSSI.java | 60 ---------------------- .../java/org/onap/so/beans/nsmf/NssInstance.java | 46 +++++++++++++++++ .../java/org/onap/so/beans/nsmf/OperationType.java | 59 +++++++++++++++++++++ .../so/beans/nsmf/OrchestrationStatusEnum.java | 36 +++++++++++++ .../java/org/onap/so/beans/nsmf/ServiceInfo.java | 6 +++ 7 files changed, 196 insertions(+), 61 deletions(-) create mode 100644 common/src/main/java/org/onap/so/beans/nsmf/CustomerInfo.java delete mode 100644 common/src/main/java/org/onap/so/beans/nsmf/NSSI.java create mode 100644 common/src/main/java/org/onap/so/beans/nsmf/NssInstance.java create mode 100644 common/src/main/java/org/onap/so/beans/nsmf/OperationType.java create mode 100644 common/src/main/java/org/onap/so/beans/nsmf/OrchestrationStatusEnum.java (limited to 'common') diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ActDeActNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/ActDeActNssi.java index ed82500210..b14cf7e94d 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/ActDeActNssi.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/ActDeActNssi.java @@ -20,16 +20,19 @@ package org.onap.so.beans.nsmf; +import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; @JsonInclude(JsonInclude.Include.NON_NULL) -public class ActDeActNssi { +public class ActDeActNssi implements Serializable { public final static String ACT_URL = "/api/rest/provMns/v1/NSS/%s" + "/activation"; public final static String DE_ACT_URL = "/api/rest/provMns/v1/NSS/%s" + "/deactivation"; + private static final long serialVersionUID = 7597630091910711349L; + private String nsiId; private String nssiId; diff --git a/common/src/main/java/org/onap/so/beans/nsmf/CustomerInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/CustomerInfo.java new file mode 100644 index 0000000000..6381d5b6e2 --- /dev/null +++ b/common/src/main/java/org/onap/so/beans/nsmf/CustomerInfo.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + # Copyright (c) 2020, 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; + +import lombok.Builder; +import lombok.Data; +import java.io.Serializable; + +@Data +@Builder +public class CustomerInfo implements Serializable { + private static final long serialVersionUID = -8749985097619384358L; + + private String globalSubscriberId; + + private String serviceInstanceId; + + private String subscriptionServiceType; + + private String operationId; + + private OperationType operationType; + + private String nsiId; + + private String snssai; + +} 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 deleted file mode 100644 index a57458f2cf..0000000000 --- a/common/src/main/java/org/onap/so/beans/nsmf/NSSI.java +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * ============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/NssInstance.java b/common/src/main/java/org/onap/so/beans/nsmf/NssInstance.java new file mode 100644 index 0000000000..396e8fce45 --- /dev/null +++ b/common/src/main/java/org/onap/so/beans/nsmf/NssInstance.java @@ -0,0 +1,46 @@ +/*- + * ============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; + +import lombok.Builder; +import lombok.Data; +import java.io.Serializable; + +@Data +@Builder +public class NssInstance implements Serializable { + + private static final long serialVersionUID = -153484249182203537L; + + private String nssiId; + + private String modelInvariantId; + + private String modelVersionId; + + private NetworkType networkType; + + private OperationType operationType; + + private String snssai; + + private String serviceType; +} diff --git a/common/src/main/java/org/onap/so/beans/nsmf/OperationType.java b/common/src/main/java/org/onap/so/beans/nsmf/OperationType.java new file mode 100644 index 0000000000..1ee56b5ca0 --- /dev/null +++ b/common/src/main/java/org/onap/so/beans/nsmf/OperationType.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + # Copyright (c) 2020, 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; + +import lombok.Getter; +import lombok.ToString; + +@Getter +@ToString +public enum OperationType { + /** + * allocate + */ + ALLOCATE("allocate"), + + DEALLOCATE("deallocate"), + + CREATE("create"), + + TERMINATE("terminate"), + + ACTIVATE("activation"), + + DEACTIVATE("deactivation"); + + private String type; + + + OperationType(String type) { + this.type = type; + } + + public static OperationType getOperationType(String value) { + for (OperationType operationType : OperationType.values()) { + if (operationType.type.equalsIgnoreCase(value)) { + return operationType; + } + } + return null; + } +} diff --git a/common/src/main/java/org/onap/so/beans/nsmf/OrchestrationStatusEnum.java b/common/src/main/java/org/onap/so/beans/nsmf/OrchestrationStatusEnum.java new file mode 100644 index 0000000000..572a312265 --- /dev/null +++ b/common/src/main/java/org/onap/so/beans/nsmf/OrchestrationStatusEnum.java @@ -0,0 +1,36 @@ +package org.onap.so.beans.nsmf; + +import lombok.Getter; +import lombok.ToString; + +@Getter +@ToString +public enum OrchestrationStatusEnum { + /** + * activated + */ + ACTIVATED("activated"), + + /** + * deactivated + */ + DEACTIVATED("deactivated"), + + ; + + private String value; + + + OrchestrationStatusEnum(String value) { + this.value = value; + } + + public static OrchestrationStatusEnum getStatus(String value) { + for (OrchestrationStatusEnum orchestrationStatus : OrchestrationStatusEnum.values()) { + if (orchestrationStatus.value.equalsIgnoreCase(value)) { + return orchestrationStatus; + } + } + return null; + } +} diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java index f9848fca31..5146685058 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/ServiceInfo.java @@ -20,11 +20,17 @@ package org.onap.so.beans.nsmf; import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; @JsonInclude(JsonInclude.Include.NON_NULL) @Data +@Builder +@NoArgsConstructor +@AllArgsConstructor public class ServiceInfo implements Serializable { private static final long serialVersionUID = 7895110339097615695L; -- cgit 1.2.3-korg