2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.bpmn.core.domain;
23 import java.io.Serializable;
25 import com.fasterxml.jackson.annotation.JsonIgnore;
26 import com.fasterxml.jackson.annotation.JsonInclude;
30 public abstract class Resource extends JsonWrapper implements Serializable {
32 private static final long serialVersionUID = 1L;
33 private String resourceId; // TODO name this field just id instead, should be the id of the object as it is in aai
34 protected ResourceType resourceType; // Enum of vnf or network or allotted resource
35 protected ModelInfo modelInfo;
36 private long concurrencyCounter = 1L;
38 //private List modules;
39 private ResourceInstance resourceInstance = new ResourceInstance(); // TODO possibly remove
40 private HomingSolution homingSolution = new HomingSolution();
41 @JsonInclude(JsonInclude.Include.NON_NULL)
42 private HomingSolution currentHomingSolution;
44 //common parameters for all Resources
45 private String toscaNodeType;
48 public String getResourceId() {
51 public void setResourceId(String resourceId) {
52 this.resourceId = resourceId;
54 public ModelInfo getModelInfo() {
57 public void setModelInfo(ModelInfo modelInfo) {
58 this.modelInfo = modelInfo;
61 public ResourceInstance getResourceInstance() {
62 return resourceInstance;
64 public void setResourceInstance(ResourceInstance resourceInstance) {
65 this.resourceInstance = resourceInstance;
67 public HomingSolution getHomingSolution(){
68 return homingSolution;
71 public void setHomingSolution(HomingSolution homingSolution){
72 this.homingSolution = homingSolution;
74 public HomingSolution getCurrentHomingSolution() {
75 return currentHomingSolution;
77 public void setCurrentHomingSolution(HomingSolution currentHomingSolution) {
78 this.currentHomingSolution = currentHomingSolution;
80 public void setResourceType(ResourceType resourceType) {
81 this.resourceType = resourceType;
84 public ResourceType getResourceType(){
88 public String getToscaNodeType() {
91 public void setToscaNodeType(String toscaNodeType) {
92 this.toscaNodeType = toscaNodeType;
97 public String getResourceInstanceId() {
98 return this.getResourceInstance().getInstanceId();
100 public String getResourceInstanceName() {
101 return this.getResourceInstance().getInstanceName();
105 // public String getResourceHomingSolution() {
108 public void setResourceInstanceId(String newInstanceId){
109 this.getResourceInstance().setInstanceId(newInstanceId);
111 public void setResourceInstanceName(String newInstanceName){
112 this.getResourceInstance().setInstanceName(newInstanceName);
117 // public String setResourceHomingSolution() {
120 * To be used by macro flow to increment concurrency counter after update to it's structure was completed
122 public void incrementConcurrencyCounter(){
123 this.concurrencyCounter ++;
126 * Method to get concurrency counter data
127 * @return long value for the counter
130 public long getConcurrencyCounter(){
131 return concurrencyCounter;