aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/ParticipantIntermediaryApi.java
blob: 9b3279232675e44dc875834ee9455280e950cbf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*-
 * ============LICENSE_START=======================================================
 *  Copyright (C) 2021-2023 Nordix Foundation.
 *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 * ============LICENSE_END=========================================================
 */

package org.onap.policy.clamp.acm.participant.intermediary.api;

import java.util.Map;
import java.util.UUID;
import org.onap.policy.clamp.models.acm.concepts.AcTypeState;
import org.onap.policy.clamp.models.acm.concepts.AutomationComposition;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
import org.onap.policy.clamp.models.acm.concepts.DeployState;
import org.onap.policy.clamp.models.acm.concepts.LockState;
import org.onap.policy.clamp.models.acm.concepts.StateChangeResult;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;

/**
 * This interface is used by participant implementations to use the participant intermediary.
 */
public interface ParticipantIntermediaryApi {

    /**
     * Update the state of a automation composition element.
     *
     * @param automationCompositionId the ID of the automation composition to update the state on
     * @param elementId the ID of the automation composition element to update the state on
     * @param deployState the Deploy State of the automation composition element
     * @param lockState the Lock State of the automation composition element
     * @param stateChangeResult the indicator if error occurs
     * @param message the message
     */
    void updateAutomationCompositionElementState(UUID automationCompositionId, UUID elementId, DeployState deployState,
            LockState lockState, StateChangeResult stateChangeResult, String message);

    /**
     * Get a copy of all AutomationCompositions.
     *
     * @return get all AutomationCompositions
     */
    Map<UUID, AutomationComposition> getAutomationCompositions();

    /**
     * Get a copy of the AutomationComposition by automationCompositionId.
     *
     * @param automationCompositionId the ID of the automation composition to update the state on
     * @return get the AutomationComposition
     */
    AutomationComposition getAutomationComposition(UUID automationCompositionId);

    /**
     * Get a copy of the AutomationCompositionElement by automationCompositionId and elementId.
     *
     * @param automationCompositionId the ID of the automation composition to update the state on
     * @param elementId the ID of the automation composition element to update the state on
     * @return get the AutomationCompositionElement
     */
    AutomationCompositionElement getAutomationCompositionElement(UUID automationCompositionId, UUID elementId);

    /**
     * Get a copy of all AutomationCompositionElementDefinition from all primed compositions.
     *
     * @return a Map by compositionId of Maps of AutomationCompositionElement
     */
    Map<UUID, Map<ToscaConceptIdentifier, AutomationCompositionElementDefinition>> getAcElementsDefinitions();

    /**
     * Get a copy of AutomationCompositionElementDefinitions of a composition.
     *
     * @param compositionId the composition id
     * @return a Map by element definition Id of AutomationCompositionElementDefinitions
     */
    Map<ToscaConceptIdentifier, AutomationCompositionElementDefinition> getAcElementsDefinitions(UUID compositionId);

    /**
     * Get a copy of the AutomationCompositionElementDefinition by compositionId and element definition Id.
     *
     * @param compositionId the composition id
     * @param elementId the element definition Id
     * @return the AutomationCompositionElementDefinition
     */
    AutomationCompositionElementDefinition getAcElementDefinition(UUID compositionId, ToscaConceptIdentifier elementId);

    /**
     * Send Automation Composition Element update Info to AC-runtime.
     *
     * @param automationCompositionId the ID of the automation composition to update the states
     * @param elementId the ID of the automation composition element to update the states
     * @param useState the use State
     * @param operationalState the operational State
     * @param outProperties the output Properties Map
     */
    void sendAcElementInfo(UUID automationCompositionId, UUID elementId, String useState, String operationalState,
            Map<String, Object> outProperties);

    /**
     * Send Automation Composition Definition update Info to AC-runtime.
     *
     * @param compositionId the composition id
     * @param elementId the element definition Id
     * @param outProperties the output Properties Map
     */
    void sendAcDefinitionInfo(UUID compositionId, ToscaConceptIdentifier elementId, Map<String, Object> outProperties);

    /**
     * Update the state of a Automation Composition Definition.
     *
     * @param compositionId the composition id
     * @param state the state of Automation Composition Definition
     * @param stateChangeResult the indicator if error occurs
     * @param message the message
     */
    void updateCompositionState(UUID compositionId, AcTypeState state, StateChangeResult stateChangeResult,
            String message);
}