1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\r
3 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
4 # you may not use this file except in compliance with the License. #
\r
5 # You may obtain a copy of the License at #
\r
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
9 # Unless required by applicable law or agreed to in writing, software #
\r
10 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
12 # See the License for the specific language governing permissions and #
\r
13 # limitations under the License. #
\r
14 ##############################################################################*/
\r
17 package org.oran.otf.common.model;
\r
19 import org.oran.otf.common.model.local.ParallelFlowInput;
\r
20 import org.oran.otf.common.utility.gson.Convert;
\r
21 import java.io.Serializable;
\r
22 import java.util.Date;
\r
23 import java.util.HashMap;
\r
24 import java.util.Map;
\r
25 import org.bson.types.ObjectId;
\r
26 import org.springframework.data.annotation.Id;
\r
27 import org.springframework.data.mongodb.core.mapping.Document;
\r
29 @Document(collection = "testInstances")
\r
30 public class TestInstance implements Serializable {
\r
32 private static final long serialVersionUID = 1L;
\r
36 private String testInstanceName;
\r
37 private String testInstanceDescription;
\r
38 private ObjectId groupId;
\r
39 private ObjectId testDefinitionId;
\r
40 private String processDefinitionId;
\r
41 private boolean useLatestTestDefinition;
\r
42 private boolean disabled;
\r
43 private boolean simulationMode;
\r
44 private long maxExecutionTimeInMillis;
\r
45 private Map<String, ParallelFlowInput> pfloInput;
\r
46 private Map<String, Object> internalTestData;
\r
47 private Map<String, Object> simulationVthInput;
\r
48 private Map<String, Object> testData;
\r
49 private Map<String, Object> vthInput;
\r
50 private Date createdAt;
\r
51 private Date updatedAt;
\r
52 private ObjectId createdBy;
\r
53 private ObjectId updatedBy;
\r
55 public TestInstance() {
\r
58 public TestInstance(
\r
60 String testInstanceName,
\r
61 String testInstanceDescription,
\r
63 ObjectId testDefinitionId,
\r
64 String processDefinitionId,
\r
65 boolean useLatestTestDefinition,
\r
67 boolean simulationMode,
\r
68 long maxExecutionTimeInMillis,
\r
69 HashMap<String, ParallelFlowInput> pfloInput,
\r
70 HashMap<String, Object> internalTestData,
\r
71 HashMap<String, Object> simulationVthInput,
\r
72 HashMap<String, Object> testData,
\r
73 HashMap<String, Object> vthInput,
\r
77 ObjectId updatedBy) {
\r
79 this.testInstanceName = testInstanceName;
\r
80 this.testInstanceDescription = testInstanceDescription;
\r
81 this.groupId = groupId;
\r
82 this.testDefinitionId = testDefinitionId;
\r
83 this.processDefinitionId = processDefinitionId;
\r
84 this.useLatestTestDefinition = useLatestTestDefinition;
\r
85 this.disabled = disabled;
\r
86 this.simulationMode = simulationMode;
\r
87 this.maxExecutionTimeInMillis = maxExecutionTimeInMillis;
\r
88 this.pfloInput = pfloInput;
\r
89 this.internalTestData = internalTestData;
\r
90 this.simulationVthInput = simulationVthInput;
\r
91 this.testData = testData;
\r
92 this.vthInput = vthInput;
\r
93 this.createdAt = createdAt;
\r
94 this.updatedAt = updatedAt;
\r
95 this.createdBy = createdBy;
\r
96 this.updatedBy = updatedBy;
\r
99 public static long getSerialVersionUID() {
\r
100 return serialVersionUID;
\r
103 public ObjectId get_id() {
\r
107 public void set_id(ObjectId _id) {
\r
111 public String getTestInstanceName() {
\r
112 return testInstanceName;
\r
115 public void setTestInstanceName(String testInstanceName) {
\r
116 this.testInstanceName = testInstanceName;
\r
119 public String getTestInstanceDescription() {
\r
120 return testInstanceDescription;
\r
123 public void setTestInstanceDescription(String testInstanceDescription) {
\r
124 this.testInstanceDescription = testInstanceDescription;
\r
127 public ObjectId getGroupId() {
\r
131 public void setGroupId(ObjectId groupId) {
\r
132 this.groupId = groupId;
\r
135 public ObjectId getTestDefinitionId() {
\r
136 return testDefinitionId;
\r
139 public void setTestDefinitionId(ObjectId testDefinitionId) {
\r
140 this.testDefinitionId = testDefinitionId;
\r
143 public String getProcessDefinitionId() {
\r
144 return processDefinitionId;
\r
147 public void setProcessDefinitionId(String processDefinitionId) {
\r
148 this.processDefinitionId = processDefinitionId;
\r
151 public boolean isUseLatestTestDefinition() {
\r
152 return useLatestTestDefinition;
\r
155 public void setUseLatestTestDefinition(boolean useLatestTestDefinition) {
\r
156 this.useLatestTestDefinition = useLatestTestDefinition;
\r
159 public boolean isDisabled() {
\r
163 public void setDisabled(boolean disabled) {
\r
164 this.disabled = disabled;
\r
167 public boolean isSimulationMode() {
\r
168 return simulationMode;
\r
171 public void setSimulationMode(boolean simulationMode) {
\r
172 this.simulationMode = simulationMode;
\r
175 public long getMaxExecutionTimeInMillis() {
\r
176 return maxExecutionTimeInMillis;
\r
179 public void setMaxExecutionTimeInMillis(long maxExecutionTimeInMillis) {
\r
180 this.maxExecutionTimeInMillis = maxExecutionTimeInMillis;
\r
183 public Map<String, ParallelFlowInput> getPfloInput() {
\r
187 public void setPfloInput(HashMap<String, ParallelFlowInput> pfloInput) {
\r
188 this.pfloInput = pfloInput;
\r
191 public Map<String, Object> getInternalTestData() {
\r
192 return internalTestData;
\r
195 public void setInternalTestData(HashMap<String, Object> internalTestData) {
\r
196 this.internalTestData = internalTestData;
\r
199 public Map<String, Object> getSimulationVthInput() {
\r
200 return simulationVthInput;
\r
203 public void setSimulationVthInput(HashMap<String, Object> simulationVthInput) {
\r
204 this.simulationVthInput = simulationVthInput;
\r
207 public Map<String, Object> getTestData() {
\r
211 public void setTestData(HashMap<String, Object> testData) {
\r
212 this.testData = testData;
\r
215 public Map<String, Object> getVthInput() {
\r
219 public void setVthInput(HashMap<String, Object> vthInput) {
\r
220 this.vthInput = vthInput;
\r
223 public Date getCreatedAt() {
\r
227 public void setCreatedAt(Date createdAt) {
\r
228 this.createdAt = createdAt;
\r
231 public Date getUpdatedAt() {
\r
235 public void setUpdatedAt(Date updatedAt) {
\r
236 this.updatedAt = updatedAt;
\r
239 public ObjectId getCreatedBy() {
\r
243 public void setCreatedBy(ObjectId createdBy) {
\r
244 this.createdBy = createdBy;
\r
247 public ObjectId getUpdatedBy() {
\r
251 public void setUpdatedBy(ObjectId updatedBy) {
\r
252 this.updatedBy = updatedBy;
\r
256 public String toString() {
\r
257 return Convert.objectToJson(this);
\r