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