0de211bd7d22d37d3ca1c215956f2e22c5ba3f29
[so.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019 Nordix
4  *  ================================================================================
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  *  SPDX-License-Identifier: Apache-2.0
17  *  ============LICENSE_END=========================================================
18  */
19 package org.onap.so.bpmn.infrastructure.decisionpoint.api;
20
21 import java.util.Map;
22 import org.camunda.bpm.engine.delegate.DelegateExecution;
23
24 /**
25  * This class is used to represent the Context used by {@ref ControllerRunnable}.
26  */
27 public class ControllerContext<T> {
28
29     /**
30      * Action to be executed against controller.
31      *
32      * e.g, healthcheck, scaleout, config-assign
33      *
34      * Action is case insensitive.
35      */
36     private String controllerAction;
37
38     /**
39      * Controller actor.
40      *
41      * e.g., CDS, SDNC, APPC.
42      *
43      * actor name is case insensitive.
44      */
45     private String controllerActor;
46
47     /**
48      * scope: PNF, VNF, VF.
49      */
50     private String controllerScope;
51
52     /**
53      * Execution context, buildingblockExecution or DelegateExecution.
54      */
55     private T execution;
56
57     public ControllerContext() {}
58
59     public void setExecution(T execution) {
60         this.execution = execution;
61     }
62
63     public T getExecution() {
64         return execution;
65     }
66
67     public String getControllerAction() {
68         return controllerAction;
69     }
70
71     public void setControllerAction(String controllerAction) {
72         this.controllerAction = controllerAction;
73     }
74
75     public String getControllerActor() {
76         return controllerActor;
77     }
78
79     public void setControllerActor(String controllerActor) {
80         this.controllerActor = controllerActor;
81     }
82
83     public String getControllerScope() {
84         return controllerScope;
85     }
86
87     public void setControllerScope(String controllerScope) {
88         this.controllerScope = controllerScope;
89     }
90
91     public String toString() {
92         return "Controller context for actor: " + controllerActor + ", action: " + controllerAction + ",scope: "
93                 + controllerScope;
94     }
95 }