- /*
- * Load the UEB JSON payload, any errors would result to a failure case response.
- */
- private JSONObject getUebContentAsJson(String payload, String contentKey) {
-
- JSONObject uebJsonObj;
- JSONObject uebObjContent;
-
- try {
- uebJsonObj = new JSONObject(payload);
- } catch (JSONException e) {
- logger.debug(EntityEventPolicyMsgs.UEB_INVALID_PAYLOAD_JSON_FORMAT, payload);
- logger.error(EntityEventPolicyMsgs.UEB_INVALID_PAYLOAD_JSON_FORMAT, payload);
- return null;
- }
-
- if (uebJsonObj.has(contentKey)) {
- uebObjContent = uebJsonObj.getJSONObject(contentKey);
- } else {
- logger.debug(EntityEventPolicyMsgs.UEB_FAILED_TO_PARSE_PAYLOAD, contentKey);
- logger.error(EntityEventPolicyMsgs.UEB_FAILED_TO_PARSE_PAYLOAD, contentKey);
- return null;
- }
-
- return uebObjContent;
- }
-
-
- private SpikeEventVertex initializeSpikeEventVertex(String payload) {
-
- SpikeEventVertex eventVertex = null;
- ObjectMapper mapper = new ObjectMapper();
-
- // Make sure that were were actually passed in a valid string.
- if (payload == null || payload.isEmpty()) {
- logger.debug(EntityEventPolicyMsgs.UEB_FAILED_TO_PARSE_PAYLOAD, EVENT_VERTEX);
- logger.error(EntityEventPolicyMsgs.UEB_FAILED_TO_PARSE_PAYLOAD, EVENT_VERTEX);