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
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.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;
29 * This interface is implemented by participant implementations to receive updates on automation composition elements.
31 public interface AutomationCompositionElementListener {
33 * Handle a deploy on a automation composition element.
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
39 void deploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
42 * Handle an udeploy on a automation composition element.
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
48 void undeploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
51 * Handle a lock on a automation composition element.
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
57 void lock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
60 * Handle an unlock on a automation composition element.
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
66 void unlock(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
69 * Handle a delete on a automation composition element.
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
75 void delete(CompositionElementDto compositionElement, InstanceElementDto instanceElement) throws PfModelException;
78 * Handle an update on a automation composition element.
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
85 void update(CompositionElementDto compositionElement, InstanceElementDto instanceElement,
86 InstanceElementDto instanceElementUpdated) throws PfModelException;
88 void prime(CompositionDto composition) throws PfModelException;
90 void deprime(CompositionDto composition) throws PfModelException;
92 void handleRestartComposition(CompositionDto composition, AcTypeState state) throws PfModelException;
94 void handleRestartInstance(CompositionElementDto compositionElement, InstanceElementDto instanceElement,
95 DeployState deployState, LockState lockState) throws PfModelException;
98 * Handle an update on a automation composition element.
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
106 void migrate(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget,
107 InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate) throws PfModelException;