Avoid duplicate processing code with events 35/74335/6
authorStephen Kitt <skitt@redhat.com>
Mon, 23 Jul 2018 12:43:50 +0000 (14:43 +0200)
committerSam Hague <shague@redhat.com>
Sat, 28 Jul 2018 03:31:27 +0000 (03:31 +0000)
commit577b4f5d73e295bb898858ee746ef72ec2580bb2
tree3c416971f46e289783f114514bf789f6b18d39a5
parentfea8c7a446c415d68a5a31882a7161f115e840ea
Avoid duplicate processing code with events

When we use event callbacks to react to the appearance of
currently-missing data, we might as well use that as the nominal flow
too: if the data is present, the event callback's underlying listener
will fire immediately, and the callback will be handled straight
away. This avoids duplicating code whenever an event callback is
used.

If performance testing reveals that fast paths are needed, we can
handle that centrally in the event callback mechanism, instead of
repeating it at every call site.

Change-Id: I49791d810946988c704a9cfe24297c977c1c8c84
Signed-off-by: Stephen Kitt <skitt@redhat.com>
natservice/impl/src/main/java/org/opendaylight/netvirt/natservice/internal/AbstractSnatService.java