2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.mso.bpmn.core.domain;
\r
23 import java.io.Serializable;
\r
25 import com.fasterxml.jackson.annotation.JsonIgnore;
\r
26 import com.fasterxml.jackson.annotation.JsonInclude;
\r
30 public abstract class Resource extends JsonWrapper implements Serializable {
\r
32 private static final long serialVersionUID = 1L;
\r
33 private String resourceId; // TODO name this field just id instead, should be the id of the object as it is in aai
\r
34 protected ResourceType resourceType; // Enum of vnf or network or allotted resource
\r
35 protected ModelInfo modelInfo;
\r
36 private long concurrencyCounter = 1L;
\r
38 //private List modules;
\r
39 private ResourceInstance resourceInstance = new ResourceInstance(); // TODO possibly remove
\r
40 private HomingSolution homingSolution = new HomingSolution();
\r
41 @JsonInclude(JsonInclude.Include.NON_NULL)
\r
42 private HomingSolution currentHomingSolution;
\r
44 //common parameters for all Resources
\r
45 private String toscaNodeType;
\r
48 public String getResourceId() {
\r
51 public void setResourceId(String resourceId) {
\r
52 this.resourceId = resourceId;
\r
54 public ModelInfo getModelInfo() {
\r
57 public void setModelInfo(ModelInfo modelInfo) {
\r
58 this.modelInfo = modelInfo;
\r
61 public ResourceInstance getResourceInstance() {
\r
62 return resourceInstance;
\r
64 public void setResourceInstance(ResourceInstance resourceInstance) {
\r
65 this.resourceInstance = resourceInstance;
\r
67 public HomingSolution getHomingSolution(){
\r
68 return homingSolution;
\r
71 public void setHomingSolution(HomingSolution homingSolution){
\r
72 this.homingSolution = homingSolution;
\r
74 public HomingSolution getCurrentHomingSolution() {
\r
75 return currentHomingSolution;
\r
77 public void setCurrentHomingSolution(HomingSolution currentHomingSolution) {
\r
78 this.currentHomingSolution = currentHomingSolution;
\r
80 public void setResourceType(ResourceType resourceType) {
\r
81 this.resourceType = resourceType;
\r
84 public ResourceType getResourceType(){
\r
85 return resourceType;
\r
88 public String getToscaNodeType() {
\r
89 return toscaNodeType;
\r
91 public void setToscaNodeType(String toscaNodeType) {
\r
92 this.toscaNodeType = toscaNodeType;
\r
97 public String getResourceInstanceId() {
\r
98 return this.getResourceInstance().getInstanceId();
\r
100 public String getResourceInstanceName() {
\r
101 return this.getResourceInstance().getInstanceName();
\r
105 // public String getResourceHomingSolution() {
\r
108 public void setResourceInstanceId(String newInstanceId){
\r
109 this.getResourceInstance().setInstanceId(newInstanceId);
\r
111 public void setResourceInstanceName(String newInstanceName){
\r
112 this.getResourceInstance().setInstanceName(newInstanceName);
\r
117 // public String setResourceHomingSolution() {
\r
120 * To be used by macro flow to increment concurrency counter after update to it's structure was completed
\r
122 public void incrementConcurrencyCounter(){
\r
123 this.concurrencyCounter ++;
\r
126 * Method to get concurrency counter data
\r
127 * @return long value for the counter
\r
130 public long getConcurrencyCounter(){
\r
131 return concurrencyCounter;
\r