Update documentation for restart ACM
[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 - PARTICIPANT_RESTART: a message received from clamp-acm runtime server with tosca definitions and the Ac instances to handle restarting
31
32 Outbound messages
33 -----------------
34 - PARTICIPANT_REGISTER: is sent by a participant during startup
35 - PARTICIPANT_DEREGISTER: is sent by a participant during shutdown
36 - PARTICIPANT_STATUS: is sent by a participant as heartbeat with the status and health of a participant
37 - AUTOMATIONCOMPOSITION_STATECHANGE_ACK: is an acknowledgement sent by a participant as a response to AutomationCompositionStateChange
38 - AUTOMATION_COMPOSITION_DEPLOY_ACK: is an acknowledgement sent by a participant as a response to AutomationCompositionDeploy
39 - PARTICIPANT_PRIME_ACK: is an acknowledgement sent by a participant as a response to ParticipantPrime
40
41 Design of a PARTICIPANT_REGISTER message
42 ----------------------------------------
43 - A participant starts and send a PARTICIPANT_REGISTER message with participantId and Supported Element Definition Types
44 - in AC-runtime ParticipantRegisterListener collects the message from Message Broker
45 - if participant is not present in DB, it saves participant reference with status ON_LINE to DB
46 - It triggers the execution to send a PARTICIPANT_REGISTER_ACK message to the participant registered
47 - if participant is present in DB and there are AC Definitions related to the Participant, 
48   it triggers the execution to send a PARTICIPANT_RESTART message to the participant restarted 
49
50 Design of a PARTICIPANT_DEREGISTER message
51 ------------------------------------------
52 - A participant is going to close and undeploys all AC-elements and send a PARTICIPANT_DEREGISTER message
53 - in AC-runtime, ParticipantDeregisterListener collects the message from Message Broker
54 - It saves participant reference with status OFF_LINE to DB
55 - It triggers the execution to send a PARTICIPANT_DEREGISTER_ACK message to the participant deregistered
56 - Participant is not monitored.
57
58 Prime of an Automation Composition Definition Type
59 --------------------------------------------------
60 - AC-runtime assigns the AC Definition to the participants based of Supported Element Definition Type by participant
61 - it triggers the execution to send a broadcast PARTICIPANT_PRIME message
62 - the message is built by ParticipantPrimePublisher using Tosca Service Template data (to fill the list of ParticipantDefinition)
63 - Participant-intermediary will receive a PARTICIPANT_PRIME message and stores the Tosca Service Template data on ParticipantHandler
64
65 DePrime of an Automation Composition Definition Type
66 ----------------------------------------------------
67 - AC-runtime triggers the execution to send a broadcast PARTICIPANT_PRIME message
68 - the message is built by ParticipantPrimePublisher with an empty list of ParticipantDefinition
69 - Participant-intermediary will receive a PARTICIPANT_PRIME message and deletes the Tosca Service Template data on ParticipantHandler
70
71 Design of "issues automation composition commands to automation compositions" - case UNDEPLOYED to DEPLOYED
72 -----------------------------------------------------------------------------------------------------------
73 - AUTOMATION_COMPOSITION_DEPLOY message with instantiation details and DEPLOY order state is sent to participants
74 - Participant-intermediary validates the current deployState change
75 - Participant-intermediary will receive AUTOMATION_COMPOSITION_DEPLOY message and sends the details of AutomationCompositionElements to participants
76 - Each participant performs its designated job of deployment by interacting with respective frameworks
77
78 Design of "issues automation composition commands to automation compositions" - case DEPLOYED to UNDEPLOYED
79 -----------------------------------------------------------------------------------------------------------
80 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and UNDEPLOY order state is sent to participants
81 - Participant-intermediary validates the current deployState change
82 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message and sends AC-element details to participants
83 - Each participant performs its designated job of undeployment by interacting with respective frameworks
84
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 ParticipantHandler
92
93 Design of "issues automation composition commands to automation compositions" - case LOCKED to UNLOCKED
94 -------------------------------------------------------------------------------------------------------
95 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and UNLOCK order state is sent to participants
96 - Participant-intermediary validates the current lockState change
97 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message
98
99 Design of "issues automation composition commands to automation compositions" - case UNLOCKED to LOCKED
100 -------------------------------------------------------------------------------------------------------
101 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and LOCK order state is sent to participants
102 - Participant-intermediary validates the current lockState change
103
104 Design of Delete - case UNDEPLOYED to DELETED
105 ---------------------------------------------
106 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and DELETE order state is sent to participants
107 - Participant-intermediary validates the current deployState change
108 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message and sends AC-element details to participants
109 - Each participant performs its designated job of removing instantiation data if not done in undeployment
110 - Participant-intermediary will remove instantiation data
111
112 Design of a PARTICIPANT_STATUS_REQ message
113 ------------------------------------------
114 - AC-runtime triggers the execution to send a broadcast PARTICIPANT_STATUS_REQ message or to send it to a specific participant
115 - the message is built by ParticipantStatusReqPublisher
116 - Participant-intermediary will receive a PARTICIPANT_STATUS_REQ message
117
118 Design of a PARTICIPANT_STATUS message
119 --------------------------------------
120 - A participant sends a scheduled PARTICIPANT_STATUS message or in response to a PARTICIPANT_STATUS_REQ message
121 - This message will hold the state and healthStatus of all the participants running actively
122 - PARTICIPANT_STATUS message holds a special attribute to return Tosca definitions, this attribute is populated only in response to PARTICIPANT_STATUS_REQ
123
124 Design of a AUTOMATION_COMPOSITION_DEPLOY_ACK message
125 -----------------------------------------------------
126 - A participant sends AUTOMATION_COMPOSITION_DEPLOY_ACK message in response to a AUTOMATION_COMPOSITION_DEPLOY message.
127 - For each AC-elements moved to the ordered state as indicated by the AUTOMATION_COMPOSITION_DEPLOY
128 - AutomationCompositionUpdateAckListener in AC-runtime collects the messages from Message Broker
129 - It checks the deployStatus of all automation composition elements
130 - It updates the AC-instance in DB accordingly
131
132 Design of a AUTOMATIONCOMPOSITION_STATECHANGE_ACK message
133 ---------------------------------------------------------
134 - A participant sends AUTOMATIONCOMPOSITION_STATECHANGE_ACK message in response to a AUTOMATIONCOMPOSITION_STATECHANGE message.
135 - For each AC-elements moved to the ordered state as indicated by the AUTOMATIONCOMPOSITION_STATECHANGE
136 - AutomationCompositionStateChangeAckListener in AC-runtime collects the messages from Message Broker
137 - It checks the deployStatus/lockStatus of all automation composition elements
138 - It updates the AC-instance in DB accordingly