Versions Compared

Key

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

...

Jira
serverONAP Jira
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-1392

Steps


  1. Consume Event
  2. Check if dataCategory is 'CM'
  3. log consumption
  4. Check scheme
  5. Create object


Consumer Pseudo Code

Code Block
titlePseudo Code
collapsetrue
public class SubscriptionCreatedEventConsumer {
	public void consumeSubscriptionEvent(final SubscriptionCreatedEvent subscriptionCreatedEvent){
		if(subscriptionCreatedEvent.dataCategory == 'CM'){				//Check dataCategory
			log.debug(consuming event subscriptionCreatedEvent...);
			if(checkFormat(subscriptionCreatedEvent)){					//Check format of message
				Subscription createSubscription = new Subscription()	//Create Object
				log.debug(subscription created createSubscription)
			}
		}
	}
 	public boolean checkFormat(SubscriptionCreatedEvent event){
		//Determine when schema confirmed
	}
}


Subscription Object

Code Block
titleObject Parameters
collapsetrue
String clientID
Stirng name
String subscriptionID = clientID+name
Boolean isTagged = default no

String dataspace
String dataCategory	= necessary? should always be 'CM'
String dataProvidor
String schemeName
String schemaVersion

Collection persistence

Issues & Decisions

Package : event.avc

#IssueNotes Decision
1Subscription Event Scheme

Protocol : Kafka Event
Topic : variable topic name

Code Block
titleEvent Scheme
collapsetrue
{
  "version": "<event type version>",
  "eventType": "subscriptionCreated",
  "event": {
    "subscription": {
      "clientID": "<unique identifier for the client >",
      "name": "<unique subscription name per client>",
      "isTagged": "<yes|no>, optional parameter, default is no"
    },
    "dataType": {
      "dataspace": "<data space>",
      "dataCategory": "<data category type>",
      "dataProvider": "<data provider type>"
      "schemaName": "<schema name>"
      "schemaVersion": "<schema version>"
    },
    "predicates": {
      "<parameter>": "<value>",
      "param2": [
        "value21",
        "value22"
      ]
    }
  }
}
2Consumer Pseudo Code
Code Block
titlePseudo Code
collapsetrue
public class SubscriptionCreatedEventConsumer {
	public void consumeSubscriptionEvent(final SubscriptionCreatedEvent subscriptionCreatedEvent){
		if(subscriptionCreatedEvent.dataCategory == 'CM'){				//Check dataCategory
			log.debug(consuming event subscriptionCreatedEvent...);
			if(checkFormat(subscriptionCreatedEvent)){					//Check format of message
				Subscription createSubscription = new Subscription()	//Create Object
				log.debug(subscription created createSubscription)
			}
		}
	}
 	public boolean checkFormat(SubscriptionCreatedEvent event){
		//Determine when schema confirmed
	}
}

3Subscription Object Code Block
titleObject Parameters
collapsetrue
String clientID Stirng name String subscriptionID = clientID+name Boolean isTagged = default no String dataspace String dataCategory = necessary? should always be 'CM' String dataProvidor String schemeName String schemaVersion Collection persistence