Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / MSOCoreBPMN / src / main / java / org / onap / so / bpmn / core / domain / ResourceDecomposition.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.bpmn.core.domain;
22
23 import java.io.Serializable;
24 import com.fasterxml.jackson.annotation.JsonIgnore;
25
26 /**
27  * Abstract superclass for all individual decomposition resources
28  * 
29  */
30 // @JsonIgnoreProperties
31 public abstract class ResourceDecomposition extends JsonWrapper implements Serializable {
32
33     private static final long serialVersionUID = 1L;
34
35     protected String resourceType; // Enum of vnf or network or allotted resource
36     private ModelInfo modelInfo;
37
38     // private List modules;
39     private ResourceInstance instanceData = new ResourceInstance();
40
41     // GET and SET
42     public ModelInfo getModelInfo() {
43         return modelInfo;
44     }
45
46     public void setModelInfo(ModelInfo modelInfo) {
47         this.modelInfo = modelInfo;
48     }
49
50     public ResourceInstance getInstanceData() {
51         return instanceData;
52     }
53
54     public void setInstanceData(ResourceInstance instanceData) {
55         this.instanceData = instanceData;
56     }
57
58     public void setResourceType(String resourceType) {
59         this.resourceType = resourceType;
60     }
61
62     // Utility methods
63     @JsonIgnore
64     public ModelInfo getResourceModel() {
65         return modelInfo;
66     }
67
68     @JsonIgnore
69     public String getResourceInstanceId() {
70         return this.getInstanceData().getInstanceId();
71     }
72
73     @JsonIgnore
74     public String getResourceInstanceName() {
75         return this.getInstanceData().getInstanceName();
76     }
77     // @JsonIgnore
78     // public String getResourceHomingSolution() {
79     // }
80
81     public void setResourceInstanceId(String newInstanceId) {
82         this.getInstanceData().setInstanceId(newInstanceId);
83     }
84
85     public void setResourceInstanceName(String newInstanceName) {
86         this.getInstanceData().setInstanceName(newInstanceName);
87     }
88     // @JsonIgnore
89     // public String setResourceHomingSolution() {
90     // }
91 }