NSSMF Manager models 79/102479/1
authorjananib <janani.b@huawei.com>
Thu, 27 Feb 2020 11:06:54 +0000 (16:36 +0530)
committerjananib <janani.b@huawei.com>
Thu, 27 Feb 2020 11:06:54 +0000 (16:36 +0530)
Adding models to NSSMF Manager

Change-Id: Ie3bb8554c0de12a1fc8703a1dd67a20d4e8ae33c
Issue-ID: SO-2544
Signed-off-by: jananib <janani.b@huawei.com>
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/HttpMethod.java [new file with mode: 0644]
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/JobStatus.java [new file with mode: 0644]
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfInfo.java [new file with mode: 0644]

diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/HttpMethod.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/HttpMethod.java
new file mode 100644 (file)
index 0000000..f6abd98
--- /dev/null
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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.
+ * 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.adapters.nssmf.rest;
+
+public enum HttpMethod {
+    GET, POST, PUT, DELETE, PATCH;
+
+    public static HttpMethod fromString(String s) {
+        if (s == null)
+            return null;
+        if (("get").equalsIgnoreCase(s))
+            return GET;
+        if (("post").equalsIgnoreCase(s))
+            return POST;
+        if (("put").equalsIgnoreCase(s))
+            return PUT;
+        if (("delete").equalsIgnoreCase(s))
+            return DELETE;
+        if (("patch").equalsIgnoreCase(s))
+            return PATCH;
+        throw new IllegalArgumentException("Invalid value for HTTP Method: " + s);
+    }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/JobStatus.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/JobStatus.java
new file mode 100644 (file)
index 0000000..f2e651f
--- /dev/null
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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.
+ * 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.adapters.nssmf.rest;
+
+import org.onap.so.adapters.nssmf.exceptions.ApplicationException;
+
+
+public enum JobStatus {
+    STARTED, PROCESSING, FINISHED, ERROR;
+
+    public static JobStatus fromString(String s) throws ApplicationException {
+        if (s == null)
+            return null;
+        if (("started").equalsIgnoreCase(s))
+            return STARTED;
+        if (("processing").equalsIgnoreCase(s))
+            return PROCESSING;
+        if (("finished").equalsIgnoreCase(s))
+            return FINISHED;
+        if (("error").equalsIgnoreCase(s))
+            return ERROR;
+        throw new ApplicationException(500, "Invalid value for Job " + "Status: " + s);
+    }
+}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfInfo.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/rest/NssmfInfo.java
new file mode 100644 (file)
index 0000000..6306643
--- /dev/null
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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.
+ * 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.adapters.nssmf.rest;
+
+public class NssmfInfo {
+
+    private String url;
+
+    private String ipAddress;
+
+    private String port;
+
+    private String insecure;
+
+    private String cacert;
+
+    private String userName;
+
+    private String password;
+
+    public String getInsecure() {
+        return insecure;
+    }
+
+    public void setInsecure(String insecure) {
+        this.insecure = insecure;
+    }
+
+    public String getCacert() {
+        return cacert;
+    }
+
+    public void setCacert(String cacert) {
+        this.cacert = cacert;
+    }
+
+    public String getIpAddress() {
+        return ipAddress;
+    }
+
+    public void setIpAddress(String ipAddress) {
+        this.ipAddress = ipAddress;
+    }
+
+    public String getPort() {
+        return port;
+    }
+
+    public void setPort(String port) {
+        this.port = port;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}