891f5771ea0cb1b412c621de7046150fba1267ed
[policy/parent.git] / docs / clamp / acm / design-impl / participants / participant-intermediary.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2
3 .. _clamp-acm-participant-intermediary:
4
5 Participant Intermediary
6 ########################
7
8 The CLAMP Participant Intermediary is a common library in ONAP, which does common message and
9 state handling for participant implementations. It provides a Java API, which participant
10 implementations implement to receive and send messages to the CLAMP runtime and to handle
11 Automation Composition Element state.
12
13 Terminology
14 -----------
15 - Broadcast message: a message for all participants (participantId=null)
16 - Message to a participant: a message only for a participant (participantId properly filled)
17 - MessageSender: a class that takes care of sending messages from participant-intermediary
18 - GUI: graphical user interface, Postman or a Front-End Application
19 - Message Broker: supported message Broker are DMaap and Strimzi-Kafka
20
21 Inbound messages to participants
22 --------------------------------
23 - PARTICIPANT_REGISTER_ACK: received as a response from clamp-acm runtime server as an acknowledgement to ParticipantRegister message sent from a participant
24 - PARTICIPANT_DEREGISTER_ACK: received as a response from clamp-acm runtime server as an acknowledgement to ParticipantDeregister message sent from a participant
25 - AUTOMATION_COMPOSITION_STATE_CHANGE: a message received from clamp-acm runtime server for a state change of clamp-acm
26 - AUTOMATION_COMPOSITION_DEPLOY: a message received from clamp-acm runtime server for a clamp-acm deploy with clamp-acm instances
27 - PARTICIPANT_PRIME: a message received from clamp-acm runtime server for a participant update with tosca definitions of clamp-acm
28 - PARTICIPANT_STATUS_REQ: A status request received from clamp-acm runtime server to send an immediate ParticipantStatus from all participants
29 - PROPERTIES_UPDATE: a message received from clamp-acm runtime server for updating the Ac instance property values
30 - AUTOMATION_COMPOSITION_MIGRATION: a message received from clamp-acm runtime server for migrating the Ac instance from a composition definition to a composition definition target
31 - PARTICIPANT_RESTART: a message received from clamp-acm runtime server with tosca definitions and the Ac instances to handle restarting
32
33 Outbound messages
34 -----------------
35 - PARTICIPANT_REGISTER: is sent by a participant during startup
36 - PARTICIPANT_DEREGISTER: is sent by a participant during shutdown
37 - PARTICIPANT_STATUS: is sent by a participant as heartbeat with the status and health of a participant
38 - AUTOMATIONCOMPOSITION_STATECHANGE_ACK: is an acknowledgement sent by a participant as a response to AutomationCompositionStateChange
39 - AUTOMATION_COMPOSITION_DEPLOY_ACK: is an acknowledgement sent by a participant as a response to AutomationCompositionDeploy
40 - PARTICIPANT_PRIME_ACK: is an acknowledgement sent by a participant as a response to ParticipantPrime
41
42 Design of a PARTICIPANT_REGISTER message
43 ----------------------------------------
44 - A participant starts and send a PARTICIPANT_REGISTER message with participantId and Supported Element Definition Types
45 - in AC-runtime ParticipantRegisterListener collects the message from Message Broker
46 - if participant is not present in DB, it saves participant reference with status ON_LINE to DB
47 - It triggers the execution to send a PARTICIPANT_REGISTER_ACK message to the participant registered
48 - if participant is present in DB and there are AC Definitions related to the Participant, 
49   it triggers the execution to send a PARTICIPANT_RESTART message to the participant restarted 
50
51 Design of a PARTICIPANT_DEREGISTER message
52 ------------------------------------------
53 - A participant is going to close and undeploys all AC-elements and send a PARTICIPANT_DEREGISTER message
54 - in AC-runtime, ParticipantDeregisterListener collects the message from Message Broker
55 - It saves participant reference with status OFF_LINE to DB
56 - It triggers the execution to send a PARTICIPANT_DEREGISTER_ACK message to the participant deregistered
57 - Participant is not monitored.
58
59 Prime of an Automation Composition Definition Type
60 --------------------------------------------------
61 - AC-runtime assigns the AC Definition to the participants based of Supported Element Definition Type by participant
62 - it triggers the execution to send a broadcast PARTICIPANT_PRIME message
63 - the message is built by ParticipantPrimePublisher using Tosca Service Template data (to fill the list of ParticipantDefinition)
64 - Participant-intermediary will receive a PARTICIPANT_PRIME message and stores the Tosca Service Template data on CacheProvider
65
66 DePrime of an Automation Composition Definition Type
67 ----------------------------------------------------
68 - AC-runtime triggers the execution to send a broadcast PARTICIPANT_PRIME message
69 - the message is built by ParticipantPrimePublisher with an empty list of ParticipantDefinition
70 - Participant-intermediary will receive a PARTICIPANT_PRIME message and deletes the Tosca Service Template data on CacheProvider
71
72 Design of "issues automation composition commands to automation compositions" - case UNDEPLOYED to DEPLOYED
73 -----------------------------------------------------------------------------------------------------------
74 - AUTOMATION_COMPOSITION_DEPLOY message with instantiation details and DEPLOY order state is sent to participants
75 - Participant-intermediary validates the current deployState change
76 - Participant-intermediary will receive AUTOMATION_COMPOSITION_DEPLOY message and sends the details of AutomationCompositionElements to participants
77 - Each participant performs its designated job of deployment by interacting with respective frameworks
78
79 Design of "issues automation composition commands to automation compositions" - case DEPLOYED to UNDEPLOYED
80 -----------------------------------------------------------------------------------------------------------
81 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and UNDEPLOY order state is sent to participants
82 - Participant-intermediary validates the current deployState change
83 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message and sends AC-element details to participants
84 - Each participant performs its designated job of undeployment by interacting with respective frameworks
85
86 Update of an Automation Composition Instance
87 --------------------------------------------
88 - AC-runtime updates the instance properties of the deployed Ac instances
89 - it triggers the execution to send a broadcast PROPERTIES_UPDATE message
90 - the message is built by AcElementPropertiesPublisher using the REST request payload (to fill the list of elements with the updated property values)
91 - Participant-intermediary will receive a PROPERTIES_UPDATE message and stores the updated values of the elements on CacheProvider
92
93 Migrate of an Automation Composition Instance
94 ---------------------------------------------
95 - AC-runtime saves the compositionTargetId and updates the instance properties of the deployed Ac instances
96 - it triggers the execution to send a broadcast AUTOMATION_COMPOSITION_MIGRATION message
97 - the message is built by AutomationCompositionMigrationPublisher using the REST request payload (to fill the compositionTargetId and list of elements with the updated property values)
98 - Participant-intermediary will receive a AUTOMATION_COMPOSITION_MIGRATION message and stores the compositionTargetId and the updated values of the elements on CacheProvider
99
100 Design of "issues automation composition commands to automation compositions" - case LOCKED to UNLOCKED
101 -------------------------------------------------------------------------------------------------------
102 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and UNLOCK order state is sent to participants
103 - Participant-intermediary validates the current lockState change
104 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message
105
106 Design of "issues automation composition commands to automation compositions" - case UNLOCKED to LOCKED
107 -------------------------------------------------------------------------------------------------------
108 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and LOCK order state is sent to participants
109 - Participant-intermediary validates the current lockState change
110
111 Design of Delete - case UNDEPLOYED to DELETED
112 ---------------------------------------------
113 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and DELETE order state is sent to participants
114 - Participant-intermediary validates the current deployState change
115 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message and sends AC-element details to participants
116 - Each participant performs its designated job of removing instantiation data if not done in undeployment
117 - Participant-intermediary will remove instantiation data
118
119 Design of a PARTICIPANT_STATUS_REQ message
120 ------------------------------------------
121 - AC-runtime triggers the execution to send a broadcast PARTICIPANT_STATUS_REQ message or to send it to a specific participant
122 - the message is built by ParticipantStatusReqPublisher
123 - Participant-intermediary will receive a PARTICIPANT_STATUS_REQ message
124
125 Design of a PARTICIPANT_STATUS message
126 --------------------------------------
127 - A participant sends a scheduled PARTICIPANT_STATUS message or in response to a PARTICIPANT_STATUS_REQ message
128 - This message will hold the state and healthStatus of all the participants running actively
129 - PARTICIPANT_STATUS message holds a special attribute to return Tosca definitions, this attribute is populated only in response to PARTICIPANT_STATUS_REQ
130
131 Design of a AUTOMATION_COMPOSITION_DEPLOY_ACK message
132 -----------------------------------------------------
133 - A participant sends AUTOMATION_COMPOSITION_DEPLOY_ACK message in response to a AUTOMATION_COMPOSITION_DEPLOY message.
134 - For each AC-elements moved to the ordered state as indicated by the AUTOMATION_COMPOSITION_DEPLOY
135 - AutomationCompositionUpdateAckListener in AC-runtime collects the messages from Message Broker
136 - It checks the deployStatus of all automation composition elements
137 - It updates the AC-instance in DB accordingly
138
139 Design of a AUTOMATIONCOMPOSITION_STATECHANGE_ACK message
140 ---------------------------------------------------------
141 - A participant sends AUTOMATIONCOMPOSITION_STATECHANGE_ACK message in response to a AUTOMATIONCOMPOSITION_STATECHANGE message.
142 - For each AC-elements moved to the ordered state as indicated by the AUTOMATIONCOMPOSITION_STATECHANGE
143 - AutomationCompositionStateChangeAckListener in AC-runtime collects the messages from Message Broker
144 - It checks the deployStatus/lockStatus of all automation composition elements
145 - It updates the AC-instance in DB accordingly