Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

  • Each LCM state change triggers a notification to the user to notify about the state change
  • When a cm handle is registered it will be in 'ADVISED' state and data-sync will be set to false by the module-sync watchdog
  • If the user wants to enable data-sync -  it has to enable it on its dedicated API endpoint
  • Only the handles with enabled data-sync will be picked up by the data-sync watchdog
  • If the handles are to be deleted during update then their states will be set to 'DELETING' before the deletion happens, then after it to 'DELETED'
  • If the data-sync watchdog starts to work with on a cm Handle state transitions to 'READY' or 'LOCKED' whether data-sync succeeded or failed respectively

Diagram of the possible transactions between CM-Handle states

Excerpt Include
DW:CPS-799 Spike: Define states and state handling for CM handle
DW:CPS-799 Spike: Define states and state handling for CM handle

Notification details

Notification handling in code

Embed draw.io Diagram
diagramNameUntitled Diagram
includedDiagram1
width627
pageId138872901

The Event structure of the notification

Event schema

Code Block
languageyml
titleLcmEvent Scema (cps-ncmp-events)
collapsetrue
{

  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "urn:cps:org.onap.ncmp.cmhandle.lcm-event:v1",

  "$ref": "#/definitions/LcmEvent",

  "definitions": {

    "Values": {
      "description": "Values that represents the state of a cmHandle",
      "type": "object",
      "properties": {
        "dataSyncEnabled":{
          "description": "Whether data sync enabled",
          "type": "boolean"
        },
        "cmHandleState": {
          "description": "State of cmHandle",
          "type": "string",
          "enum": ["ADVISED", "READY", "LOCKED", "DELETING", "DELETED"]
        },
        "cmHandleProperties": {
          "description": "cmHandle properties",
          "type": "object",
          "default": null,
          "existingJavaType": "java.util.List<java.util.Map<String,String>>",
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },

    "Event": {
      "description": "The Payload of an event",
      "type": "object",
      "properties": {
        "cmHandleId": {
          "description": "cmHandle id",
          "type": "string"
        },
        "oldValues": {
          "$ref": "#/definitions/Values"
        },
        "newValues": {
          "$ref": "#/definitions/Values"
        }
      },
      "required": [
        "cmHandleId"
      ],
      "additionalProperties": false
    },

    "LcmEvent": {
      "description": "The payload for LCM event",
      "type": "object",
      "javaType" : "org.onap.ncmp.cmhandle.event.lcm.LcmEvent",
      "properties": {
        "eventId": {
          "description": "The unique id identifying the event",
          "type": "string"
        },
        "eventCorrelationId": {
          "description": "The id identifying the event",
          "type": "string"
        },
        "eventTime": {
          "description": "The timestamp when original event occurred",
          "type": "string"
        },
        "eventSource": {
          "description": "The source of the event",
          "type": "string"
        },
        "eventType": {
          "description": "The type of the event",
          "type": "string"
        },
        "eventSchema": {
          "description": "The schema that this event adheres to",
          "type": "string"
        },
        "eventSchemaVersion": {
          "description": "The version of the schema that this event adheres to",
          "type": "string"
        },
        "event": {
          "$ref": "#/definitions/Event"
        }
      },
      "required": [
        "eventId",
        "eventCorrelationId",
        "eventTime",
        "eventSource",
        "eventType",
        "eventSchema",
        "eventSchemaVersion",
        "event"
      ],
      "additionalProperties": false
    }

  }
}


Event examples

Excerpt Include
CPS-1104 Agree LCM Event schemas
CPS-1104 Agree LCM Event schemas

Typical use cases which leads to state changes and trigger notification events

State changes after new cm Handle is registered

Gliffy Diagram
macroIdd9e40a29-f5cb-481d-b05f-01789d35b77a
displayNameState change use case diagram
nameState change use case diagram
pagePin17

State changes after cm Handle update received

Gliffy Diagram
displayNameCm handle state changes after update
nameCm handle state changes after update
pagePin6

State changes happens during data-sync watchdog execution

Gliffy Diagram
displayNameState changes in watchdog
nameState changes in watchdog
pagePin17

Source materials

Important links to related Spikes and Implementation proposals
(From latest to older ones)