From f0b47d22cead551756e8d708e8dcf9628e6cc595 Mon Sep 17 00:00:00 2001 From: s00370346 Date: Fri, 12 Apr 2019 17:30:02 +0530 Subject: Issue-ID: DCAEGEN2-1055 BBS test bug fixes Change-Id: I43314e5e81027cfd4deef71a183d19fad4248626 Signed-off-by: s00370346 --- dpo/blueprints/k8s-rcc-policy.yaml-template | 2 +- dpo/data-formats/dmaap.json | 2 +- dpo/spec/rcc_spec.json | 2 +- etc/collector.properties | 5 +- etc/ont_config.json | 19 ++++++ .../java/org/onap/dcae/ApplicationSettings.java | 5 ++ .../java/org/onap/dcae/common/EventProcessor.java | 79 ++++++++++++++++++++-- .../java/org/onap/dcae/common/RestapiCallNode.java | 36 ++++++++-- .../org/onap/dcae/controller/AccessController.java | 2 + .../dcae/controller/PersistentEventConnection.java | 32 ++++++++- .../org/onap/dcae/common/EventProcessorTest.java | 27 +++++++- 11 files changed, 192 insertions(+), 19 deletions(-) create mode 100644 etc/ont_config.json diff --git a/dpo/blueprints/k8s-rcc-policy.yaml-template b/dpo/blueprints/k8s-rcc-policy.yaml-template index 6c98b95..2a36e41 100755 --- a/dpo/blueprints/k8s-rcc-policy.yaml-template +++ b/dpo/blueprints/k8s-rcc-policy.yaml-template @@ -94,7 +94,7 @@ node_templates: topic_url: get_input: notification_publish_url type: message_router - rcc_policy: '[{"controller_name":"AccessM&C","controller_restapiUrl":"192.167.1.3:8080","controller_restapiUser":"access","controller_restapiPassword":"Huawei@123","controller_accessTokenUrl":"/rest/plat/smapp/v1/oauth/token","controller_accessTokenFile":"./etc/access-token.json","controller_accessTokenMethod":"put","controller_subsMethod":"post","controller_subscriptionUrl":"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription","event_details":[{"event_name":"ONT_registration","event_description":"ONTregistartionevent","event_sseventUrlEmbed":"true","event_sseventsField":"output.url","event_sseventsUrl":"null","event_subscriptionTemplate":"./etc/ont_registartion_subscription_template.json","event_unSubscriptionTemplate":"./etc/ont_registartion_unsubscription_template.json","event_ruleId":"12345678"}]}]' + rcc_policy: '[{"controller_name":"AccessM&C","controller_restapiUrl":"192.167.1.3:8080","controller_restapiUser":"access","controller_restapiPassword":"Huawei@123","controller_accessTokenUrl":"/rest/plat/smapp/v1/oauth/token","controller_accessTokenFile":"./etc/access-token.json","controller_accessTokenMethod":"put","controller_subsMethod":"post","controller_subscriptionUrl":"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription","event_details":[{"event_name":"ONT_registration","event_description":"ONTregistartionevent","event_sseventUrlEmbed":"true","event_sseventsField":"output.url","event_sseventsUrl":"null","event_subscriptionTemplate":"./etc/ont_registartion_subscription_template.json","event_unSubscriptionTemplate":"./etc/ont_registartion_unsubscription_template.json","event_ruleId":"12345678","modifyData":"true","modifyMethod":"modifyOntEvent"}]}]' interfaces: cloudify.interfaces.lifecycle: start: diff --git a/dpo/data-formats/dmaap.json b/dpo/data-formats/dmaap.json index 11c08d3..a3bc835 100644 --- a/dpo/data-formats/dmaap.json +++ b/dpo/data-formats/dmaap.json @@ -4,7 +4,7 @@ "aaf_password": "PASSWORD", "type": "message_router", "dmaap_info": { - "topic_url": "https://HOSTNAME:3905/events/unauthenticated.DCAE_RCC_OUTPUT" + "topic_url": "https://HOSTNAME:3904/events/unauthenticated.DCAE_RCC_OUTPUT" } } } \ No newline at end of file diff --git a/dpo/spec/rcc_spec.json b/dpo/spec/rcc_spec.json index 2cae9ff..b4f446f 100644 --- a/dpo/spec/rcc_spec.json +++ b/dpo/spec/rcc_spec.json @@ -134,7 +134,7 @@ { "name": "rcc_policy", "description": "RCC Policy JSON", - "value":"[{\"controller_name\":\"AccessM&C\",\"controller_restapiUrl\":\"192.167.1.3:8080\",\"controller_restapiUser\":\"access\",\"controller_restapiPassword\":\"Huawei@123\",\"controller_accessTokenUrl\":\"/rest/plat/smapp/v1/oauth/token\",\"controller_accessTokenFile\":\"./etc/access-token.json\",\"controller_accessTokenMethod\":\"put\",\"controller_subsMethod\":\"post\",\"controller_subscriptionUrl\":\"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription\",\"event_details\":[{\"event_name\":\"ONT_registration\",\"event_description\":\"ONTregistartionevent\",\"event_sseventUrlEmbed\":\"true\",\"event_sseventsField\":\"output.url\",\"event_sseventsUrl\":\"null\",\"event_subscriptionTemplate\":\"./etc/ont_registartion_subscription_template.json\",\"event_unSubscriptionTemplate\":\"./etc/ont_registartion_unsubscription_template.json\",\"event_ruleId\":\"12345678\"}]}]", + "value":"[{\"controller_name\":\"AccessM&C\",\"controller_restapiUrl\":\"192.167.1.3:8080\",\"controller_restapiUser\":\"access\",\"controller_restapiPassword\":\"Huawei@123\",\"controller_accessTokenUrl\":\"/rest/plat/smapp/v1/oauth/token\",\"controller_accessTokenFile\":\"./etc/access-token.json\",\"controller_accessTokenMethod\":\"put\",\"controller_subsMethod\":\"post\",\"controller_subscriptionUrl\":\"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription\",\"event_details\":[{\"event_name\":\"ONT_registration\",\"event_description\":\"ONTregistartionevent\",\"event_sseventUrlEmbed\":\"true\",\"event_sseventsField\":\"output.url\",\"event_sseventsUrl\":\"null\",\"event_subscriptionTemplate\":\"./etc/ont_registartion_subscription_template.json\",\"event_unSubscriptionTemplate\":\"./etc/ont_registartion_unsubscription_template.json\",\"event_ruleId\":\"12345678\", \"modifyData\": \"true\", \"modifyMethod\": \"modifyOntEvent\"}]}]", "sourced_at_deployment": false, "policy_editable": true, "designer_editable": false diff --git a/etc/collector.properties b/etc/collector.properties index 3bee48e..1cca357 100755 --- a/etc/collector.properties +++ b/etc/collector.properties @@ -70,7 +70,7 @@ collector.rcc.inputQueue.maxPending=8096 ## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile collector.rcc.dmaap.streamid=notification=device-registration collector.dmaapfile=./etc/DmaapConfig.json -rcc_policy = [{\"controller_name\":\"AccessM&C\",\"controller_restapiUrl\":\"10.118.191.43:26335\",\"controller_restapiUser\":\"access\",\"controller_restapiPassword\":\"Huawei@123\",\"controller_accessTokenUrl\":\"/rest/plat/smapp/v1/oauth/token\",\"controller_accessTokenFile\":\"./etc/access-token.json\",\"controller_accessTokenMethod\":\"put\",\"controller_subsMethod\":\"post\",\"controller_subscriptionUrl\":\"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription\",\"event_details\":[{\"event_name\":\"ONT_registration\",\"event_description\":\"ONTregistartionevent\",\"event_sseventUrlEmbed\":\"true\",\"event_sseventsField\":\"output.url\",\"event_sseventsUrl\":\"null\",\"event_subscriptionTemplate\":\"./etc/ont_registartion_subscription_template.json\",\"event_unSubscriptionTemplate\":\"./etc/ont_registartion_unsubscription_template.json\",\"event_ruleId\":\"777777777\"}]}] +rcc_policy = [{\"controller_name\":\"AccessM&C\",\"controller_restapiUrl\":\"10.118.191.43:26335\",\"controller_restapiUser\":\"access\",\"controller_restapiPassword\":\"Huawei@123\",\"controller_accessTokenUrl\":\"/rest/plat/smapp/v1/oauth/token\",\"controller_accessTokenFile\":\"./etc/access-token.json\",\"controller_accessTokenMethod\":\"put\",\"controller_subsMethod\":\"post\",\"controller_subscriptionUrl\":\"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription\",\"event_details\":[{\"event_name\":\"ONT_registration\",\"event_description\":\"ONTregistartionevent\",\"event_sseventUrlEmbed\":\"true\",\"event_sseventsField\":\"output.url\",\"event_sseventsUrl\":\"null\",\"event_subscriptionTemplate\":\"./etc/ont_registartion_subscription_template.json\",\"event_unSubscriptionTemplate\":\"./etc/ont_registartion_unsubscription_template.json\",\"event_ruleId\":\"777777777\", \"modifyData\": \"true\", \"modifyMethod\": \"modifyOntEvent\"}]}] # Describes at what frequency (measured in minutes) should application try to fetch config from CBS @@ -88,3 +88,6 @@ collector.keystore.file.location=etc/keystore collector.keystore.passwordfile=etc/rcc_passwordfile collector.rcc.keystore.alias=tomcat collector.rcc.service.secure.clientauth=0 + + +collector.eventinfo=etc/ont_config.json \ No newline at end of file diff --git a/etc/ont_config.json b/etc/ont_config.json new file mode 100644 index 0000000..68a2fa0 --- /dev/null +++ b/etc/ont_config.json @@ -0,0 +1,19 @@ +{ + "lastServiceDate" : "", + "macAddress" : "54:04:a6:38:12:9d", + "manufactureDate" : "", + "modelNumber": "", + "oamV4IpAddress": "", + "oamV6IpAddress": "", + "serialNumber": "", + "softwareVersion": "", + "unitFamily": "", + "unitType": "", + "vendorName": "Huawei", + "additionalFields" : { + "attachment-point": "", + "svlan": "100", + "cvlan": "10", + "remote-id": "AC9.0234.0337" + } +} \ No newline at end of file diff --git a/src/main/java/org/onap/dcae/ApplicationSettings.java b/src/main/java/org/onap/dcae/ApplicationSettings.java index 8bf32c4..9caf2f6 100644 --- a/src/main/java/org/onap/dcae/ApplicationSettings.java +++ b/src/main/java/org/onap/dcae/ApplicationSettings.java @@ -171,6 +171,11 @@ public class ApplicationSettings { return prependWithUserDirOnRelative(properties.getString("collector.dmaapfile", "etc/DmaapConfig.json")); } + public String controllerConfigFileLocation() { + return prependWithUserDirOnRelative(properties.getString("collector.eventinfo", "etc/ont_config.json")); + } + + public String dMaaPStreamsMapping() { return properties.getString("collector.rcc.dmaap.streamid", null); } diff --git a/src/main/java/org/onap/dcae/common/EventProcessor.java b/src/main/java/org/onap/dcae/common/EventProcessor.java index cf44921..259e3b2 100644 --- a/src/main/java/org/onap/dcae/common/EventProcessor.java +++ b/src/main/java/org/onap/dcae/common/EventProcessor.java @@ -25,9 +25,13 @@ import org.json.JSONException; import org.json.JSONObject; import org.onap.dcae.RestConfCollector; import org.onap.dcae.common.publishing.EventPublisher; +import org.onap.dcae.controller.PersistentEventConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -65,7 +69,7 @@ public class EventProcessor implements Runnable { } else { sendEventsToStreams(streamIdList, ev); } - log.info("Event published" + ev.getEventObj()); + } } catch (Exception e) { log.error("EventProcessor InterruptedException" + e.getMessage()); @@ -75,11 +79,24 @@ public class EventProcessor implements Runnable { private void sendEventsToStreams(String[] streamIdList, EventData ev) { for (String aStreamIdList : streamIdList) { - log.info("Invoking publisher for streamId:" + aStreamIdList); + log.info("Invoking publisher for streamId: " + aStreamIdList); if (!ev.getConn().getEventRuleId().equals("")) { - JSONObject customHeader = new JSONObject(); - customHeader.put("rule-id", ev.getConn().getEventRuleId()); - eventPublisher.sendEvent(overrideEvent(customHeader, ev.getEventObj()), aStreamIdList); + JSONObject modifiedObj = ev.getEventObj(); + if (ev.getConn().isModifyEvent()){ + try { + log.info("Invoking method " + ev.getConn().getModifyMethod() + " isModify " + ev.getConn().isModifyEvent()); + modifiedObj = (JSONObject)(this.getClass().getMethod(ev.getConn().getModifyMethod(), EventData.class).invoke(this, ev)); + }catch (Exception e) { + log.warn("No such method exist" + e); + } + } + JSONObject addRuleId = new JSONObject(); + addRuleId.put("rule-id", ev.getConn().getEventRuleId()); + JSONObject customHeader = overrideEvent(addRuleId, modifiedObj); + customHeader.put("notification-id", ev.getEventObj().getJSONObject("notification").get("notification-id")); + JSONObject finalObject = overrideEvent(customHeader, addRuleId); + log.info("Event published" + finalObject); + eventPublisher.sendEvent(finalObject, aStreamIdList); } else { eventPublisher.sendEvent(ev.getEventObj(), aStreamIdList); } @@ -97,7 +114,57 @@ public class EventProcessor implements Runnable { } catch (JSONException e) { throw new RuntimeException("JSON Exception" + e); } - log.info("Merged json " + mergedJSON); + return mergedJSON; } + + public JSONObject modifyOntEvent(EventData ev) { + PersistentEventConnection conn = ev.getConn(); + JSONObject json1 = ev.getEventObj(); + log.info("modifyOntEvent"); + JSONObject newJSON = new JSONObject(); + JSONObject finalObj = new JSONObject(); + Path configFile = Paths.get(conn.getParentCtrllr().getProperties().controllerConfigFileLocation()); + try { + //log.info("Paths " + configFile.toString()); + String bytes = new String(Files.readAllBytes(configFile)); + //log.info("Bytes " + bytes); + newJSON = new JSONObject(bytes); + newJSON.put("serialNumber", json1.getJSONObject("notification").getJSONObject("message").getJSONObject("content").getJSONObject("onu").get("sn")); + newJSON.put("softwareVersion", json1.getJSONObject("notification").getJSONObject("message").get("version")); + + String refParentLTPNativeId = json1.getJSONObject("notification").getJSONObject("message").getJSONObject("content").getJSONObject("onu").get("refParentLTPNativeId").toString(); + String olt_slot = ""; + String olt_port = ""; + String[] list = refParentLTPNativeId.split(","); + for (String aList : list) { + String domain = aList.split("=")[0]; + String value = aList.substring(aList.indexOf('=') + 1); + switch (domain) + { + case "S": + olt_slot = value; + break; + case "PP": + olt_port = value.replaceAll("[^a-zA-Z0-9]", ""); + break; + default: + log.info("Field" + domain + " value " + value); + break; + } + } + String oltName = json1.getJSONObject("notification").getJSONObject("message").getJSONObject("content").getJSONObject("onu").get("refParentNeNativeId").toString(); + oltName = oltName.substring(3); + JSONObject additionalfields = newJSON.getJSONObject("additionalFields"); + String attachment_point = oltName + "-" + olt_slot + "-" + olt_port; + additionalfields.put("attachment-point", attachment_point); + //additionalfields.put("remote-id", attachment-point); + } catch (Exception e) { + log.info("File reading error " + e); + } + //log.info("Modified json " + newJSON); + finalObj.put("pnfRegistration", newJSON); + log.info("final obj"+ finalObj.toString()); + return finalObj; + } } diff --git a/src/main/java/org/onap/dcae/common/RestapiCallNode.java b/src/main/java/org/onap/dcae/common/RestapiCallNode.java index 01da72d..6fb232c 100755 --- a/src/main/java/org/onap/dcae/common/RestapiCallNode.java +++ b/src/main/java/org/onap/dcae/common/RestapiCallNode.java @@ -34,10 +34,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; +import javax.net.ssl.*; import javax.ws.rs.core.EntityTag; import javax.ws.rs.core.MultivaluedMap; import java.io.FileInputStream; @@ -46,6 +43,7 @@ import java.net.SocketException; import java.nio.file.Files; import java.nio.file.Paths; import java.security.KeyStore; +import java.security.cert.X509Certificate; import java.util.*; import static org.onap.dcae.common.RestapiCallNodeUtil.getParameters; @@ -319,6 +317,35 @@ public class RestapiCallNode { } protected HttpResponse sendHttpRequest(String request, Parameters p) throws Exception { + /* Enable this code if external controller's keyStore file not availabale */ + /*Create a trust manager that does not validate certificate chains*/ +// TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() { +// public java.security.cert.X509Certificate[] getAcceptedIssuers() { +// return null; +// } +// public void checkClientTrusted(X509Certificate[] certs, String authType) { +// } +// public void checkServerTrusted(X509Certificate[] certs, String authType) { +// } +// } +// }; +// +// // Install the all-trusting trust manager +// SSLContext sc = SSLContext.getInstance("SSL"); +// sc.init(null, trustAllCerts, new java.security.SecureRandom()); +// HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); +// +// // Create all-trusting host name verifier +// HostnameVerifier allHostsValid = new HostnameVerifier() { +// public boolean verify(String hostname, SSLSession session) { +// return true; +// } +// }; +// +// // Install the all-trusting host verifier +// log.info("Warning!!! No SSL handshake **************************************"); +// HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); + /*HELPER CODE END */ ClientConfig config = new DefaultClientConfig(); SSLContext ssl = null; if (p.ssl && p.restapiUrl.startsWith("https")) { @@ -330,7 +357,6 @@ public class RestapiCallNode { config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(hostnameVerifier, ssl)); } - logProperties(config.getProperties()); Client client = Client.create(config); diff --git a/src/main/java/org/onap/dcae/controller/AccessController.java b/src/main/java/org/onap/dcae/controller/AccessController.java index c77772e..c2ed5e3 100644 --- a/src/main/java/org/onap/dcae/controller/AccessController.java +++ b/src/main/java/org/onap/dcae/controller/AccessController.java @@ -176,6 +176,8 @@ public class AccessController { .setEventUnSubscriptionTemplate( event.get("event_unSubscriptionTemplate").toString()) .setEventRuleId(event.get("event_ruleId").toString()).setParentCtrllr(this) + .setModifyEvent(Boolean.parseBoolean(event.get("modifyData").toString())) + .setModifyMethod(event.get("modifyMethod").toString()) .createPersistentEventConnection(); eventList.put(name, conn); diff --git a/src/main/java/org/onap/dcae/controller/PersistentEventConnection.java b/src/main/java/org/onap/dcae/controller/PersistentEventConnection.java index 860c0c9..c963129 100644 --- a/src/main/java/org/onap/dcae/controller/PersistentEventConnection.java +++ b/src/main/java/org/onap/dcae/controller/PersistentEventConnection.java @@ -55,7 +55,8 @@ public class PersistentEventConnection implements Runnable { private EventConnectionState state; private volatile boolean running = true; private static final Logger log = LoggerFactory.getLogger(PersistentEventConnection.class); - + private boolean modifyEvent; + private String modifyMethod; private RestConfContext ctx; private AccessController parentCtrllr; @@ -72,6 +73,8 @@ public class PersistentEventConnection implements Runnable { private String event_unSubscriptionTemplate; private String event_ruleId; private AccessController parentCtrllr; + private boolean modifyEvent; + private String modifyMethod; public PersistentEventConnectionBuilder setEventName(String event_name) { this.event_name = event_name; @@ -118,9 +121,20 @@ public class PersistentEventConnection implements Runnable { return this; } + public PersistentEventConnectionBuilder setModifyEvent(boolean modifyEvent) { + this.modifyEvent = modifyEvent; + return this; + } + + public PersistentEventConnectionBuilder setModifyMethod(String modifyMethod) { + this.modifyMethod = modifyMethod; + return this; + } public PersistentEventConnection createPersistentEventConnection() { return new PersistentEventConnection(this); } + + } @@ -135,6 +149,8 @@ public class PersistentEventConnection implements Runnable { this.event_unSubscriptionTemplate = builder.event_unSubscriptionTemplate; this.event_ruleId = builder.event_ruleId; this.state = EventConnectionState.INIT; + this.modifyEvent = builder.modifyEvent; + this.modifyMethod = builder.modifyMethod; this.ctx = new RestConfContext(); for (String s : builder.parentCtrllr.getCtx().getAttributeKeySet()) { @@ -144,7 +160,7 @@ public class PersistentEventConnection implements Runnable { this.eventParaMap = new HashMap<>(); this.eventParaMap.putAll(builder.parentCtrllr.getParaMap()); printEventParamMap(); - log.info("New persistent connection created " + event_name); + log.info("New persistent connection created " + event_name + "modify event " + modifyEvent); } @@ -254,6 +270,18 @@ public class PersistentEventConnection implements Runnable { return eventParaMap.get(fieldName); } + public AccessController getParentCtrllr() { + return parentCtrllr; + } + + public boolean isModifyEvent() { + return modifyEvent; + } + + public String getModifyMethod() { + return modifyMethod; + } + public void printEventParamMap() { log.info("----------------Event Param Map-------------------"); for (String name : eventParaMap.keySet()) { diff --git a/src/test/java/org/onap/dcae/common/EventProcessorTest.java b/src/test/java/org/onap/dcae/common/EventProcessorTest.java index 4d9fade..575443f 100644 --- a/src/test/java/org/onap/dcae/common/EventProcessorTest.java +++ b/src/test/java/org/onap/dcae/common/EventProcessorTest.java @@ -86,6 +86,7 @@ public class EventProcessorTest { when(properties.keystorePasswordFileLocation()).thenReturn(KEYSTORE_PASSWORD_FILE.toString()); when(properties.rccKeystoreFileLocation()).thenReturn(RCC_KEYSTORE.toString()); when(properties.rccKeystorePasswordFileLocation()).thenReturn(RCC_KEYSTORE_PASSWORD_FILE.toString()); + when(properties.controllerConfigFileLocation()).thenReturn(Paths.get("etc/ont_config.json").toAbsolutePath().toString()); JSONObject controller = new JSONObject( "{\"controller_name\":\"AccessM&C\",\"controller_restapiUrl\":\"10.118.191.43:26335\",\"controller_restapiUser\":\"access\",\"controller_restapiPassword\":\"Huawei@123\",\"controller_accessTokenUrl\":\"/rest/plat/smapp/v1/oauth/token\",\"controller_accessTokenFile\":\"./etc/access-token.json\",\"controller_accessTokenMethod\":\"put\",\"controller_subsMethod\":\"post\",\"controller_subscriptionUrl\":\"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription\",\"event_details\":[{\"event_name\":\"ONT_registration\",\"event_description\":\"ONTregistartionevent\",\"event_sseventUrlEmbed\":\"true\",\"event_sseventsField\":\"output.url\",\"event_sseventsUrl\":\"null\",\"event_subscriptionTemplate\":\"./etc/ont_registartion_subscription_template.json\",\"event_unSubscriptionTemplate\":\"./etc/ont_registartion_unsubscription_template.json\",\"event_ruleId\":\"777777777\"}]}"); AccessController acClr = new AccessController(controller, properties); @@ -93,11 +94,33 @@ public class EventProcessorTest { PersistentEventConnection p = new PersistentEventConnection.PersistentEventConnectionBuilder().setEventName("") .setEventDescription("").setEventSseventUrlEmbed(true).setEventSseventsField("").setEventSseventsUrl("") .setEventSubscriptionTemplate("").setEventUnSubscriptionTemplate("").setEventRuleId("1234646346") - .setParentCtrllr(acClr).createPersistentEventConnection(); + .setParentCtrllr(acClr).setModifyEvent(true).setModifyMethod("modifyOntEvent").createPersistentEventConnection(); p.getEventParamMapValue("restapiUrl"); p.modifyEventParamMap("restapiUrl", "10.118.191.43:26335"); RestConfCollector.fProcessingInputQueue = new LinkedBlockingQueue<>(4); - RestConfCollector.fProcessingInputQueue.offer(new EventData(p, new JSONObject("{}"))); + RestConfCollector.fProcessingInputQueue.offer(new EventData(p, new JSONObject("{\n" + + " \"notification\" : {\n" + + " \"notification-id\" : \"01010101011\",\n" + + " \"event-time\" : \"2019-3-9T3:30:30.547z\",\n" + + " \"message\" : {\n" + + " \"object-type\" : \"onu\",\n" + + " \"topic\" : \"resources\",\n" + + " \"version\" : \"v1\",\n" + + " \"operation\" : \"create\",\n" + + " \"content\" : {\n" + + " \"onu\" : {\n" + + " \"alias\" : \"\",\n" + + " \"refParentLTP\" : \"gpon.0.5.1\",\n" + + " \"sn\" : \"HWTCC01B7503\",\n" + + " \"refParentLTPNativeId\" : \"NE=167772165,FR=0,S=5,CP=-1,PP=||1|\",\n" + + " \"onuId\": \"\",\n" + + " \"refParentNE\" : \"aaaaaaaaa-aaaaa-aaaa-aaaa-aaa167772165\",\n" + + " \"refParentNeNativeId\": \"NE=167772165\"\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + "}"))); RestConfCollector.fProcessingInputQueue.offer(new EventData(null, null)); EventProcessor ev = new EventProcessor(eventPublisher, streamMap); ev.run(); -- cgit 1.2.3-korg