7cbd565c775525944704125a8a315a133592095c
[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
25 import com.fasterxml.jackson.annotation.JsonIgnore;
26
27 /**
28  * Abstract superclass for all individual decomposition resources
29  * 
30  */
31 //@JsonIgnoreProperties
32 public abstract class ResourceDecomposition extends JsonWrapper  implements Serializable {
33
34         private static final long serialVersionUID = 1L;
35         
36         protected String resourceType; // Enum of vnf or network or allotted resource
37         private ModelInfo modelInfo;
38
39         //private List modules;
40         private ResourceInstance instanceData = new ResourceInstance();
41         
42         // GET and SET
43         public ModelInfo getModelInfo() {
44                 return modelInfo;
45         }
46         public void setModelInfo(ModelInfo modelInfo) {
47                 this.modelInfo = modelInfo;
48         }
49
50         public ResourceInstance getInstanceData() {
51                 return instanceData;
52         }
53         public void setInstanceData(ResourceInstance instanceData) {
54                 this.instanceData = instanceData;
55         }
56         public void setResourceType(String resourceType) {
57                 this.resourceType = resourceType;
58         }
59
60         //Utility methods
61         @JsonIgnore
62         public ModelInfo getResourceModel() {
63                 return modelInfo;
64         }
65         @JsonIgnore
66         public String getResourceInstanceId() {
67                 return this.getInstanceData().getInstanceId();
68         }
69         @JsonIgnore
70         public String getResourceInstanceName() {
71                 return this.getInstanceData().getInstanceName();
72         }
73 //      @JsonIgnore
74 //      public String getResourceHomingSolution() {
75 //      }
76         
77         public void setResourceInstanceId(String newInstanceId){
78                 this.getInstanceData().setInstanceId(newInstanceId);
79         }
80         public void setResourceInstanceName(String newInstanceName){
81                 this.getInstanceData().setInstanceName(newInstanceName);
82         }
83 //      @JsonIgnore
84 //      public String setResourceHomingSolution() {
85 //      }
86 }