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;
24 import com.fasterxml.jackson.annotation.JsonIgnore;
25 import com.fasterxml.jackson.annotation.JsonInclude;
29 public abstract class Resource extends JsonWrapper implements Serializable {
31 private static final long serialVersionUID = 1L;
32 private String resourceId; // TODO name this field just id instead, should be the id of the object as it is in aai
33 protected ResourceType resourceType; // Enum of vnf or network or allotted resource
34 protected ModelInfo modelInfo;
35 private long concurrencyCounter = 1L;
37 // private List modules;
38 private ResourceInstance resourceInstance = new ResourceInstance(); // TODO possibly remove
39 private HomingSolution homingSolution = new HomingSolution();
40 @JsonInclude(JsonInclude.Include.NON_NULL)
41 private HomingSolution currentHomingSolution;
43 // common parameters for all Resources
44 private String toscaNodeType;
47 public String getResourceId() {
51 public void setResourceId(String resourceId) {
52 this.resourceId = resourceId;
55 public ModelInfo getModelInfo() {
59 public void setModelInfo(ModelInfo modelInfo) {
60 this.modelInfo = modelInfo;
63 public ResourceInstance getResourceInstance() {
64 return resourceInstance;
67 public void setResourceInstance(ResourceInstance resourceInstance) {
68 this.resourceInstance = resourceInstance;
71 public HomingSolution getHomingSolution() {
72 return homingSolution;
75 public void setHomingSolution(HomingSolution homingSolution) {
76 this.homingSolution = homingSolution;
79 public HomingSolution getCurrentHomingSolution() {
80 return currentHomingSolution;
83 public void setCurrentHomingSolution(HomingSolution currentHomingSolution) {
84 this.currentHomingSolution = currentHomingSolution;
87 public void setResourceType(ResourceType resourceType) {
88 this.resourceType = resourceType;
91 public ResourceType getResourceType() {
95 public String getToscaNodeType() {
99 public void setToscaNodeType(String toscaNodeType) {
100 this.toscaNodeType = toscaNodeType;
105 public String getResourceInstanceId() {
106 return this.getResourceInstance().getInstanceId();
109 public String getResourceInstanceName() {
110 return this.getResourceInstance().getInstanceName();
114 // public String getResourceHomingSolution() {
117 public void setResourceInstanceId(String newInstanceId) {
118 this.getResourceInstance().setInstanceId(newInstanceId);
121 public void setResourceInstanceName(String newInstanceName) {
122 this.getResourceInstance().setInstanceName(newInstanceName);
127 // public String setResourceHomingSolution() {
130 * To be used by macro flow to increment concurrency counter after update to it's structure was completed
132 public void incrementConcurrencyCounter() {
133 this.concurrencyCounter++;
137 * Method to get concurrency counter data
139 * @return long value for the counter
142 public long getConcurrencyCounter() {
143 return concurrencyCounter;