2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021-2025 OpenInfra Foundation Europe. All rights reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.clamp.acm.participant.intermediary.api;
23 import org.onap.policy.models.base.PfModelException;
26 * This interface is implemented by participant implementations to receive updates on automation composition elements.
28 public interface AutomationCompositionElementListener {
30 * Handle a deployment on an automation composition element.
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
36 void deploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
39 * Handle an udeploy on an automation composition element.
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
45 void undeploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
48 * Handle a lock on an automation composition element.
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
54 void lock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
57 * Handle an unlock on an automation composition element.
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
63 void unlock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
66 * Handle delete on an automation composition element.
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
72 void delete(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
75 * Handle an update on an automation composition element.
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
82 void update(CompositionElementDto compositionElement, InstanceElementDto instanceElement,
83 InstanceElementDto instanceElementUpdated) throws PfModelException;
85 void prime(CompositionDto composition) throws PfModelException;
87 void deprime(CompositionDto composition) throws PfModelException;
90 * Handle an update on an automation composition element.
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
99 void migrate(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget,
100 InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate,
101 int nextStage) throws PfModelException;
103 void migratePrecheck(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget,
104 InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate)
105 throws PfModelException;
107 void review(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
108 throws PfModelException;
110 void prepare(CompositionElementDto compositionElement, InstanceElementDto instanceElement, int nextStage)
111 throws PfModelException;
114 * Rollback migration changes done to a composition.
116 * @param compositionElement the composition to roll back the changes
117 * @param instanceElement instance to roll back the changes
118 * @param nextStage in which stage should the instance be after the rollback
119 * @throws PfModelException if anything goes wrong
121 void rollbackMigration(CompositionElementDto compositionElement,
122 InstanceElementDto instanceElement, int nextStage)
123 throws PfModelException;