Override Event Management Topic Open API functionality
The Event Management Topic Open API enables you to save topic records in the Topic [sn_api_notif_mgmt_topic] table after validating the topic payload.
You can override the processing of a topic record by updating the methods in the TopicAPIUtilsOOB API in the TopicAPIUtils API.
The following is the list of available methods within this API and the default functionality that they provide:
- TopicAPIUtilsOOB - createTopicHelper(Object topicObject, Array warnings): Inserts the payload passed in the Event Management Topic Open API - POST /sn_api_notif_mgmt/topic endpoint into the Topic [sn_api_notif_mgmt_topic] table.
- TopicAPIUtilsOOB - getCreateTopicSchema(): Returns the defined schema for the payload used by the Event Management Topic Open API - POST /sn_api_notif_mgmt/topic endpoint to validate the topic payload. The default payload schema, Constants.SCHEMA, is located in the sn_api_notif_mgmt.Constants script include.
- TopicAPIUtilsOOB - isValidCreateTopicPayload(Object topicObject, String schema, Array warnings): Validates the payload passed into the Event Management Topic Open API - POST /sn_api_notif_mgmt/topic endpoint. This validation is performed on the request body and the schema.
- TopicAPIUtilsOOB - prepareCreateTopicResponse(Object topicObject, String topicSysId, Array warnings): Generates and returns the response to a Event Management Topic Open API - POST /sn_api_notif_mgmt/topic endpoint call.
- TopicAPIUtilsOOB - processTopicCreation(Object topicObject): Processes the request made by the Event Management Topic Open API endpoint. This method invokes the helper methods needed for data insertion, schema validation, request body validation, and response-orchestration. Override this method if you need to customize the fundamental processing of the Event Management Topic Open - POST /sn_api_notif_mgmt/topic request. Otherwise, override the individual helper methods.
- TopicAPIUtilsOOB - transformCreateTopicResponse(Object topicObject, String topicSysId): Provides the ability to add custom data to the response object returned to the Event Management Topic Open API - POST /sn_api_notif_mgmt/topic endpoint.
- TopicAPIUtilsOOB - validateTopicAttributes(Object topicObject, Array details): Validates whether the topic name, header-query, content-query, and namespace combination passed in the Event Management Topic Open API endpoint payload is unique. The endpoint uses this attribute combinations to determine whether the topic currently exists in the Topic [sn_api_notif_mgmt_topic] table. The default implementation also checks whether the name attribute, which is defined as required in the default topic payload schema, is included in the passed payload.
- TopicAPIUtilsOOB - validateTopicExternalId(Object topicObject, Array details): Validates the topic external ID passed in the request body of the Event Management Topic Open API endpoint. In the base implementation this only validates that the external ID is not empty.