505f515d70a2d838ce8dd0edcb4928a2cc09839c
[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.clamp.models.acm.concepts.AcTypeState;
24 import org.onap.policy.clamp.models.acm.concepts.DeployState;
25 import org.onap.policy.clamp.models.acm.concepts.LockState;
26 import org.onap.policy.models.base.PfModelException;
27
28 /**
29  * This interface is implemented by participant implementations to receive updates on automation composition elements.
30  */
31 public interface AutomationCompositionElementListener {
32     /**
33      * Handle a deploy on a automation composition element.
34      *
35      * @param compositionElement the information of the Automation Composition Definition Element
36      * @param instanceElement the information of the Automation Composition Instance Element
37      * @throws PfModelException from Policy framework
38      */
39     void deploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
40
41     /**
42      * Handle an udeploy on a automation composition element.
43      *
44      * @param compositionElement the information of the Automation Composition Definition Element
45      * @param instanceElement the information of the Automation Composition Instance Element
46      * @throws PfModelException in case of a model exception
47      */
48     void undeploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
49
50     /**
51      * Handle a lock on a automation composition element.
52      *
53      * @param compositionElement the information of the Automation Composition Definition Element
54      * @param instanceElement the information of the Automation Composition Instance Element
55      * @throws PfModelException in case of a model exception
56      */
57     void lock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
58
59     /**
60      * Handle an unlock on a automation composition element.
61      *
62      * @param compositionElement the information of the Automation Composition Definition Element
63      * @param instanceElement the information of the Automation Composition Instance Element
64      * @throws PfModelException in case of a model exception
65      */
66     void unlock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
67
68     /**
69      * Handle a delete on a automation composition element.
70      *
71      * @param compositionElement the information of the Automation Composition Definition Element
72      * @param instanceElement the information of the Automation Composition Instance Element
73      * @throws PfModelException in case of a model exception
74      */
75     void delete(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
76
77     /**
78      * Handle an update on a automation composition element.
79      *
80      * @param compositionElement the information of the Automation Composition Definition Element
81      * @param instanceElement the information of the Automation Composition Instance Element
82      * @param instanceElementUpdated the information of the Automation Composition Instance Element updated
83      * @throws PfModelException from Policy framework
84      */
85     void update(CompositionElementDto compositionElement, InstanceElementDto instanceElement,
86             InstanceElementDto instanceElementUpdated) throws PfModelException;
87
88     void prime(CompositionDto composition) throws PfModelException;
89
90     void deprime(CompositionDto composition) throws PfModelException;
91
92     void handleRestartComposition(CompositionDto composition, AcTypeState state) throws PfModelException;
93
94     void handleRestartInstance(CompositionElementDto compositionElement, InstanceElementDto instanceElement,
95             DeployState deployState, LockState lockState) throws PfModelException;
96
97     /**
98      * Handle an update on a automation composition element.
99      *
100      * @param compositionElement the information of the Automation Composition Definition Element
101      * @param compositionElementTarget the information of the Automation Composition Definition Element Target
102      * @param instanceElement the information of the Automation Composition Instance Element
103      * @param instanceElementMigrate the information of the Automation Composition Instance Element updated
104      * @throws PfModelException from Policy framework
105      */
106     void migrate(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget,
107             InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate) throws PfModelException;
108 }