147b291ed79bcd207b396ee5b6d7c06e0406edb9
[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 org.camunda.bpm.engine.delegate.DelegateExecution;
22
23 /**
24  * This class is used to represent the Context used by {@ref ControllerRunnable}.
25  */
26 public class ControllerContext<T> {
27
28     /**
29      * Action to be executed against controller.
30      *
31      * e.g, healthcheck, scaleout, config-assign
32      *
33      * Action is case insensitive.
34      */
35     private String controllerAction;
36
37     /**
38      * Controller actor.
39      *
40      * e.g., CDS, SDNC, APPC.
41      *
42      * actor name is case insensitive.
43      */
44     private String controllerActor;
45
46     /**
47      * scope: PNF, VNF, VF.
48      */
49     private String controllerScope;
50
51     /**
52      * Execution context, buildingblockExecution or DelegateExecution.
53      */
54     private T execution;
55
56     public ControllerContext() {}
57
58     public void setExecution(T execution) {
59         this.execution = execution;
60     }
61
62     public T getExecution() {
63         return execution;
64     }
65
66     public String getControllerAction() {
67         return controllerAction;
68     }
69
70     public void setControllerAction(String controllerAction) {
71         this.controllerAction = controllerAction;
72     }
73
74     public String getControllerActor() {
75         return controllerActor;
76     }
77
78     public void setControllerActor(String controllerActor) {
79         this.controllerActor = controllerActor;
80     }
81
82     public String getControllerScope() {
83         return controllerScope;
84     }
85
86     public void setControllerScope(String controllerScope) {
87         this.controllerScope = controllerScope;
88     }
89
90     public String toString() {
91         return "Controller context for actor: " + controllerActor + ", action: " + controllerAction + ",scope: "
92                 + controllerScope;
93     }
94 }