summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/util.py
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-05-31 17:45:16 +0200
committerDave Wallace <dwallacelf@gmail.com>2016-06-09 02:41:57 +0000
commit7becd08c4b641886ad08dedb90be156f305140ee (patch)
treedf7d5caf95591ffeb9be0d37d74503633e66c890 /vpp-api/java/jvpp/gen/util.py
parent42bb61fd162b3dd469c9d98a9dc6d3e2b2eaffce (diff)
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 <mmarsale@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp/gen/util.py')
-rw-r--r--vpp-api/java/jvpp/gen/util.py22
1 files changed, 18 insertions, 4 deletions
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