summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorTait,Trevor(rt0435) <rtait@amdocs.com>2018-08-28 15:59:03 -0400
committerTait,Trevor(rt0435) <rtait@amdocs.com>2018-08-28 15:59:39 -0400
commit54dec15de7897cc737c2daa5c8f904483215ef2e (patch)
treec650537a4bb00d1c7c357ba3a2df0d4097b71912 /src/main
parentd26f38d193e2cee5b502c7418f282dc69a029a3c (diff)
Adding Network and VM
Issue-ID: LOG-614 Change-Id: I00b2f38ed0db1e1d8886732c1bbfd775704b60a4 Signed-off-by: Tait,Trevor(rt0435) <rtait@amdocs.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/Attribute.java14
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/DataQuality.java21
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/ModelContext.java8
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/Network.java86
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/Service.java4
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/VF.java16
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/VFModule.java28
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/VM.java86
-rw-r--r--src/main/java/org/onap/pomba/common/datatypes/VNFC.java4
9 files changed, 242 insertions, 25 deletions
diff --git a/src/main/java/org/onap/pomba/common/datatypes/Attribute.java b/src/main/java/org/onap/pomba/common/datatypes/Attribute.java
index d73435e..6a1f7b3 100644
--- a/src/main/java/org/onap/pomba/common/datatypes/Attribute.java
+++ b/src/main/java/org/onap/pomba/common/datatypes/Attribute.java
@@ -24,15 +24,15 @@ import com.google.gson.annotations.SerializedName;
public class Attribute {
@Expose
@SerializedName("name")
- private String name;
+ private Name name;
@Expose
@SerializedName("value")
- private Value value;
+ private String value;
@Expose
@SerializedName("dataQuality")
private DataQuality dataQuality = new DataQuality();
- public enum Value {
+ public enum Name {
adminState,
ipAddress,
hostName,
@@ -45,16 +45,16 @@ public class Attribute {
networkRole,
routerExternalBoolean
}
- public String getName() {
+ public Name getName() {
return name;
}
- public void setName(String name) {
+ public void setName(Name name) {
this.name = name;
}
- public Value getValue() {
+ public String getValue() {
return value;
}
- public void setValue(Value value) {
+ public void setValue(String value) {
this.value = value;
}
public DataQuality getDataQuality() {
diff --git a/src/main/java/org/onap/pomba/common/datatypes/DataQuality.java b/src/main/java/org/onap/pomba/common/datatypes/DataQuality.java
index 111fd94..9c442e0 100644
--- a/src/main/java/org/onap/pomba/common/datatypes/DataQuality.java
+++ b/src/main/java/org/onap/pomba/common/datatypes/DataQuality.java
@@ -49,4 +49,25 @@ public class DataQuality {
public void setErrorText(String errorText) {
this.errorText = errorText;
}
+
+ public static DataQuality ok() {
+ // as a non-mutable class, it is not safe to define a constant for this
+ DataQuality result = new DataQuality();
+ result.setStatus(Status.ok);
+ return result;
+ }
+
+ public static DataQuality error(String text) {
+ // as a non-mutable class, it is not safe to define a constant for this
+ DataQuality result = new DataQuality();
+ result.setStatus(Status.error);
+ result.setErrorText(text);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "DataQuality [status=" + this.status + ", errorText=" + this.errorText + "]";
+ }
+
}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java b/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java
index 523ed52..592d68a 100644
--- a/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java
+++ b/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java
@@ -50,19 +50,19 @@ public class ModelContext {
public void setDataQuality(DataQuality dataQuality) {
this.dataQuality = dataQuality;
}
- public List<Attribute> getAttribute() {
+ public List<Attribute> getAttributes() {
return attributeList;
}
- public void setAttribute(List<Attribute> attributeList) {
+ public void setAttributes(List<Attribute> attributeList) {
this.attributeList = attributeList;
}
public void addAttribute(Attribute attribute) {
this.attributeList.add(attribute);
}
- public List<VF> getVf() {
+ public List<VF> getVfs() {
return vfList;
}
- public void setVf(List<VF> vfList) {
+ public void setVfs(List<VF> vfList) {
this.vfList = vfList;
}
public void addVf(VF vf) {
diff --git a/src/main/java/org/onap/pomba/common/datatypes/Network.java b/src/main/java/org/onap/pomba/common/datatypes/Network.java
new file mode 100644
index 0000000..19c286c
--- /dev/null
+++ b/src/main/java/org/onap/pomba/common/datatypes/Network.java
@@ -0,0 +1,86 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.pomba.common.datatypes;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Network {
+ @Expose
+ @SerializedName("name")
+ private String name;
+ @Expose
+ @SerializedName("invariantUUID")
+ private String invariantUuid;
+ @Expose
+ @SerializedName("uuid")
+ private String uuid;
+ @Expose
+ @SerializedName("nfNamingCode")
+ private String nfcNamingCode;
+ @Expose
+ @SerializedName("dataQuality")
+ private DataQuality dataQuality = new DataQuality();
+ @Expose
+ @SerializedName("attributeList")
+ private List<Attribute> attributeList = new ArrayList<>();
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+ public String getUuid() {
+ return uuid;
+ }
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+ public String getNfcNamingCode() {
+ return nfcNamingCode;
+ }
+ public void setNfcNamingCode(String nfcType) {
+ this.nfcNamingCode = nfcType;
+ }
+ public List<Attribute> getAttributes() {
+ return attributeList;
+ }
+ public void setAttributes(List<Attribute> attributeList) {
+ this.attributeList = attributeList;
+ }
+ public void addAttribute(Attribute attribute) {
+ this.attributeList.add(attribute);
+ }
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/Service.java b/src/main/java/org/onap/pomba/common/datatypes/Service.java
index 1fde805..b225b6a 100644
--- a/src/main/java/org/onap/pomba/common/datatypes/Service.java
+++ b/src/main/java/org/onap/pomba/common/datatypes/Service.java
@@ -65,10 +65,10 @@ public class Service {
public void setDataQuality(DataQuality dataQuality) {
this.dataQuality = dataQuality;
}
- public List<Attribute> getAttribute() {
+ public List<Attribute> getAttributes() {
return attributeList;
}
- public void setAttribute(List<Attribute> attributeList) {
+ public void setAttributes(List<Attribute> attributeList) {
this.attributeList = attributeList;
}
public void addAttribute(Attribute attribute) {
diff --git a/src/main/java/org/onap/pomba/common/datatypes/VF.java b/src/main/java/org/onap/pomba/common/datatypes/VF.java
index 05fb9ec..7bbb962 100644
--- a/src/main/java/org/onap/pomba/common/datatypes/VF.java
+++ b/src/main/java/org/onap/pomba/common/datatypes/VF.java
@@ -52,7 +52,7 @@ public class VF {
private List<VFModule> vfModules = new ArrayList<>();
@Expose
@SerializedName("vnfcList")
- private List<VNFC> vnfc = new ArrayList<>();
+ private List<VNFC> vnfcs = new ArrayList<>();
public String getName() {
return name;
@@ -93,19 +93,19 @@ public class VF {
public void addVfModule(VFModule vfModule) {
this.vfModules.add(vfModule);
}
- public List<VNFC> getVnfc() {
- return vnfc;
+ public List<VNFC> getVnfcs() {
+ return vnfcs;
}
- public void setVnfc(List<VNFC> vnfc) {
- this.vnfc = vnfc;
+ public void setVnfcs(List<VNFC> vnfc) {
+ this.vnfcs = vnfc;
}
public void addVnfc(VNFC vnfc) {
- this.vnfc.add(vnfc);
+ this.vnfcs.add(vnfc);
}
- public List<Attribute> getAttribute() {
+ public List<Attribute> getAttributes() {
return attributeList;
}
- public void setAttribute(List<Attribute> attributeList) {
+ public void setAttributes(List<Attribute> attributeList) {
this.attributeList = attributeList;
}
public void addAttribute(Attribute attribute) {
diff --git a/src/main/java/org/onap/pomba/common/datatypes/VFModule.java b/src/main/java/org/onap/pomba/common/datatypes/VFModule.java
index 1c82801..876f6b2 100644
--- a/src/main/java/org/onap/pomba/common/datatypes/VFModule.java
+++ b/src/main/java/org/onap/pomba/common/datatypes/VFModule.java
@@ -49,6 +49,12 @@ public class VFModule {
@Expose
@SerializedName("attributeList")
private List<Attribute> attributeList = new ArrayList<>();
+ @Expose
+ @SerializedName("vmList")
+ private List<VM> vms = new ArrayList<>();
+ @Expose
+ @SerializedName("networkList")
+ private List<Network> networks = new ArrayList<>();
public String getName() {
@@ -87,10 +93,28 @@ public class VFModule {
public void setMinInstances(int minInstances) {
this.minInstances = minInstances;
}
- public List<Attribute> getAttribute() {
+ public List<VM> getVms() {
+ return vms;
+ }
+ public void setVms(List<VM> vms) {
+ this.vms = vms;
+ }
+ public void addVm(VM vm) {
+ this.vms.add(vm);
+ }
+ public List<Network> getNetworks() {
+ return networks;
+ }
+ public void setNetworks(List<Network> network) {
+ this.networks = network;
+ }
+ public void addNetwork(Network vnfc) {
+ this.networks.add(vnfc);
+ }
+ public List<Attribute> getAttributes() {
return attributeList;
}
- public void setAttribute(List<Attribute> attributeList) {
+ public void setAttributes(List<Attribute> attributeList) {
this.attributeList = attributeList;
}
public void addAttribute(Attribute attribute) {
diff --git a/src/main/java/org/onap/pomba/common/datatypes/VM.java b/src/main/java/org/onap/pomba/common/datatypes/VM.java
new file mode 100644
index 0000000..29f4c29
--- /dev/null
+++ b/src/main/java/org/onap/pomba/common/datatypes/VM.java
@@ -0,0 +1,86 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.pomba.common.datatypes;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class VM {
+ @Expose
+ @SerializedName("name")
+ private String name;
+ @Expose
+ @SerializedName("invariantUUID")
+ private String invariantUuid;
+ @Expose
+ @SerializedName("uuid")
+ private String uuid;
+ @Expose
+ @SerializedName("nfNamingCode")
+ private String nfcNamingCode;
+ @Expose
+ @SerializedName("dataQuality")
+ private DataQuality dataQuality = new DataQuality();
+ @Expose
+ @SerializedName("attributeList")
+ private List<Attribute> attributeList = new ArrayList<>();
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+ public String getUuid() {
+ return uuid;
+ }
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+ public String getNfcNamingCode() {
+ return nfcNamingCode;
+ }
+ public void setNfcNamingCode(String nfcType) {
+ this.nfcNamingCode = nfcType;
+ }
+ public List<Attribute> getAttributes() {
+ return attributeList;
+ }
+ public void setAttributes(List<Attribute> attributeList) {
+ this.attributeList = attributeList;
+ }
+ public void addAttribute(Attribute attribute) {
+ this.attributeList.add(attribute);
+ }
+ public DataQuality getDataQuality() {
+ return dataQuality;
+ }
+ public void setDataQuality(DataQuality dataQuality) {
+ this.dataQuality = dataQuality;
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/VNFC.java b/src/main/java/org/onap/pomba/common/datatypes/VNFC.java
index 1302b6f..66c852a 100644
--- a/src/main/java/org/onap/pomba/common/datatypes/VNFC.java
+++ b/src/main/java/org/onap/pomba/common/datatypes/VNFC.java
@@ -68,10 +68,10 @@ public class VNFC {
public void setNfcNamingCode(String nfcType) {
this.nfcNamingCode = nfcType;
}
- public List<Attribute> getAttribute() {
+ public List<Attribute> getAttributes() {
return attributeList;
}
- public void setAttribute(List<Attribute> attributeList) {
+ public void setAttributes(List<Attribute> attributeList) {
this.attributeList = attributeList;
}
public void addAttribute(Attribute attribute) {