Versions Compared

Key

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

...

Algorithm for CM Subscription Delete ( TBD )  



PlantUML Macro
titleCm Subscription Delete Algo
@startuml
'https://plantuml.com/activity-diagram-beta

start
: DME to send Cm Subscription Delete Request;
: NCMP to extract out subscriptionId;
: using subscriptionId , Query all the tracked Cm Subscriptions;
: Populate details in Cm Notification Subscription Cache;
if (all the Subscription predicates are part of ongoing Subscriptions ) then (true)
  : directly delete the subscriptionId from the ongoing subscribers list from DB;
  : mark the subscription delete request as ACCEPTED in the cache;
  : respond back to the client with ACCEPTED ;
else (false)
 : for all the 'last lights out' predicate information call the DMI Plugin;
 if (DMI Plugin accepts the delete request) then (yes)
    : using the information present in cmNotificationSubscriptionCache, delete the records from DB;
    : mark the subscription delete request as ACCEPTED in the cache;
    : respond back to the client with ACCEPTED;
 else (no)
    : dont delete any records from DB;
    : mark the subscription delete request as REJECTED in the cache;
    : respond back to the client with REJECTED;
 endif
endif
: cleanup the cache;

stop

@enduml


  1. Capture Incoming subscriptionId from the client.
  2. Query the existing subscriptions we are tracking using the subscriptionId we got from the Cm Subscription Delete request.
  3. Populate the cmSubscriptionCache with the relevant details ( this will be later used to send the response and manage the subscription ) using the above query we did.
  4. Now check if the details we have are ALL the last subscribers or not.
    1. if all are NOT the last subscribers then we can right away delete it from the DB and send back the response to the client without sending any request to the DMI.
    2. if we have mixed records then we need to make a call to the DMI for the "last lights out" to get Acceptance from DMI 
  5. if DMI accepts it , then whatever we have in the cache can be used to DELETE the rows from the DB ( similar to what we did for create )
  6. Once the rows are deleted then we can send back the response to the client and clear up the cache ( for ACCEPTED/REJECTED )

...