5994328d5e8882f4bb58defdd82c44b47236b561
[policy/clamp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2021-2024 Nordix Foundation.
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  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.clamp.acm.participant.intermediary.api;
22
23 import org.onap.policy.models.base.PfModelException;
24
25 /**
26  * This interface is implemented by participant implementations to receive updates on automation composition elements.
27  */
28 public interface AutomationCompositionElementListener {
29     /**
30      * Handle a deploy on a automation composition element.
31      *
32      * @param compositionElement the information of the Automation Composition Definition Element
33      * @param instanceElement the information of the Automation Composition Instance Element
34      * @throws PfModelException from Policy framework
35      */
36     void deploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
37
38     /**
39      * Handle an udeploy on a automation composition element.
40      *
41      * @param compositionElement the information of the Automation Composition Definition Element
42      * @param instanceElement the information of the Automation Composition Instance Element
43      * @throws PfModelException in case of a model exception
44      */
45     void undeploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
46
47     /**
48      * Handle a lock on a automation composition element.
49      *
50      * @param compositionElement the information of the Automation Composition Definition Element
51      * @param instanceElement the information of the Automation Composition Instance Element
52      * @throws PfModelException in case of a model exception
53      */
54     void lock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
55
56     /**
57      * Handle an unlock on a automation composition element.
58      *
59      * @param compositionElement the information of the Automation Composition Definition Element
60      * @param instanceElement the information of the Automation Composition Instance Element
61      * @throws PfModelException in case of a model exception
62      */
63     void unlock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
64
65     /**
66      * Handle a delete on a automation composition element.
67      *
68      * @param compositionElement the information of the Automation Composition Definition Element
69      * @param instanceElement the information of the Automation Composition Instance Element
70      * @throws PfModelException in case of a model exception
71      */
72     void delete(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
73
74     /**
75      * Handle an update on a automation composition element.
76      *
77      * @param compositionElement the information of the Automation Composition Definition Element
78      * @param instanceElement the information of the Automation Composition Instance Element
79      * @param instanceElementUpdated the information of the Automation Composition Instance Element updated
80      * @throws PfModelException from Policy framework
81      */
82     void update(CompositionElementDto compositionElement, InstanceElementDto instanceElement,
83             InstanceElementDto instanceElementUpdated) throws PfModelException;
84
85     void prime(CompositionDto composition) throws PfModelException;
86
87     void deprime(CompositionDto composition) throws PfModelException;
88
89     /**
90      * Handle an update on a automation composition element.
91      *
92      * @param compositionElement       the information of the Automation Composition Definition Element
93      * @param compositionElementTarget the information of the Automation Composition Definition Element Target
94      * @param instanceElement          the information of the Automation Composition Instance Element
95      * @param instanceElementMigrate   the information of the Automation Composition Instance Element updated
96      * @param nextStage                    the next stage
97      * @throws PfModelException from Policy framework
98      */
99     void migrate(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget,
100             InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate,
101             int nextStage) throws PfModelException;
102
103     void migratePrecheck(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget,
104             InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate) throws PfModelException;
105
106     void review(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
107         throws PfModelException;
108
109     void prepare(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
110         throws PfModelException;
111 }