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
29 public abstract class Resource extends JsonWrapper implements Serializable {
\r
31 private static final long serialVersionUID = 1L;
\r
32 private String resourceId;
\r
33 protected ResourceType resourceType; // Enum of vnf or network or allotted resource
\r
34 protected ModelInfo modelInfo;
\r
35 private long concurrencyCounter = 1L;
\r
37 //private List modules;
\r
38 private ResourceInstance resourceInstance = new ResourceInstance(); // TODO possibly remove
\r
39 private HomingSolution homingSolution = new HomingSolution(); // TODO maybe this instead of resourceInstance being "bridge"
\r
41 //common parameters for all Resources
\r
42 private String toscaNodeType;
\r
45 public String getResourceId() {
\r
48 public void setResourceId(String resourceId) {
\r
49 this.resourceId = resourceId;
\r
51 public ModelInfo getModelInfo() {
\r
54 public void setModelInfo(ModelInfo modelInfo) {
\r
55 this.modelInfo = modelInfo;
\r
58 public ResourceInstance getResourceInstance() {
\r
59 return resourceInstance;
\r
61 public void setResourceInstance(ResourceInstance resourceInstance) {
\r
62 this.resourceInstance = resourceInstance;
\r
64 public HomingSolution getHomingSolution(){
\r
65 return homingSolution;
\r
68 public void setHomingSolution(HomingSolution homingSolution){
\r
69 this.homingSolution = homingSolution;
\r
71 public void setResourceType(ResourceType resourceType) {
\r
72 this.resourceType = resourceType;
\r
75 public ResourceType getResourceType(){
\r
76 return resourceType;
\r
79 public String getToscaNodeType() {
\r
80 return toscaNodeType;
\r
82 public void setToscaNodeType(String toscaNodeType) {
\r
83 this.toscaNodeType = toscaNodeType;
\r
88 public String getResourceInstanceId() {
\r
89 return this.getResourceInstance().getInstanceId();
\r
91 public String getResourceInstanceName() {
\r
92 return this.getResourceInstance().getInstanceName();
\r
96 // public String getResourceHomingSolution() {
\r
99 public void setResourceInstanceId(String newInstanceId){
\r
100 this.getResourceInstance().setInstanceId(newInstanceId);
\r
102 public void setResourceInstanceName(String newInstanceName){
\r
103 this.getResourceInstance().setInstanceName(newInstanceName);
\r
108 // public String setResourceHomingSolution() {
\r
111 * To be used by macro flow to increment concurrency counter after update to it's structure was completed
\r
113 public void incrementConcurrencyCounter(){
\r
114 this.concurrencyCounter ++;
\r
117 * Method to get concurrency counter data
\r
118 * @return long value for the counter
\r
121 public long getConcurrencyCounter(){
\r
122 return concurrencyCounter;
\r