From 7becd08c4b641886ad08dedb90be156f305140ee Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Tue, 31 May 2016 17:45:16 +0200 Subject: VPP-119: JVpp notifications - add notification DTOs to JVpp - add notification callbacks - add notification registry - provide/implement notification registry from future and callback facades Change-Id: I1060ef2ec8ba1eb2e8cff279c93b73aa7c9f9aee Signed-off-by: Maros Marsalek --- vpp-api/java/jvpp/gen/util.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'vpp-api/java/jvpp/gen/util.py') diff --git a/vpp-api/java/jvpp/gen/util.py b/vpp-api/java/jvpp/gen/util.py index 072c9d592f2..12c8bc3170f 100644 --- a/vpp-api/java/jvpp/gen/util.py +++ b/vpp-api/java/jvpp/gen/util.py @@ -148,15 +148,21 @@ unconventional_naming_rep_req = { # # FIXME no convention in the naming of events (notifications) in vpe.api notifications_message_suffixes = ("event", "counters") -notification_messages = ["from_netconf_client", "from_netconf_server", "to_netconf_client", "to_netconf_server"] +notification_messages_reused = ["sw_interface_set_flags"] # messages that must be ignored. These messages are INSUFFICIENTLY marked as disabled in vpe.api # FIXME ignored_messages = ["is_address_reachable"] -def is_notification(param): - return param.lower().endswith(notifications_message_suffixes) or param.lower() in notification_messages +def is_notification(name): + """ Returns true if the structure is a notification regardless of its no other use """ + return is_just_notification(name) or name.lower() in notification_messages_reused + + +def is_just_notification(name): + """ Returns true if the structure is just a notification and has no other use """ + return name.lower().endswith(notifications_message_suffixes) def is_ignored(param): @@ -178,4 +184,12 @@ def is_control_ping(camel_case_name_with_suffix): def api_message_to_javadoc(api_message): """ Converts vpe.api message description to javadoc """ str = pprint.pformat(api_message, indent=4, width=120, depth=None) - return " * " + str.replace("\n", "\n * ") \ No newline at end of file + return " * " + str.replace("\n", "\n * ") + + +notification_dto_suffix = "Notification" + + +def add_notification_suffix(camel_case_dto_name): + camel_case_dto_name += notification_dto_suffix + return camel_case_dto_name \ No newline at end of file -- cgit 1.2.3-korg