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 deploy on a 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 a 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 a 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 a 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 a delete on a 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 a 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 a 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) throws PfModelException;
106 void review(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
107 throws PfModelException;
109 void prepare(CompositionElementDto compositionElement, InstanceElementDto instanceElement, int nextStage)
110 throws PfModelException;