Reference Guide

Table Of Contents
When the optional AlertService is set, an alert topic is registered using the AlertService. This
registration process will return the alert topic to use when the alert is posted. Alert topics are
persistent, thus if the topic was already registered, registering it again will have no effect.
Since AlertService is optional in SwitchManager, the alert will be posted just if the service is
available, thus a check for null is needed before posting the alert.
NOTE
As mentioned before, a better design would make use of the decorator patter [XXX] to decorate
business logic with optional dependencies
so no check for null is needed and logics with different
concerns are separated.
Optional services are bound/unbound in a multi
-th
read environment. An optional service may become
unavailable at any time and thus synchronization methods (Avoided here for simple illustration
purposes) need to be put in place.
To try the new alert feature use the Rsdoc to add and modify an OpenFlow switch so an alert is
generated.
1. Build and install the application as described in Building the Application o n p a g e 14 6 and
Installing the Application on page 147.
2. Open the HP VAN SDN Controller’s Rsdoc and authenticate as illustrated in Trying the REST API
with RSdoc on page 196.
3. Add (POST) a device using the following JSON document: { "switch": {"name": "OpenFlow
switch 1"}}(as illustrated in Figure 60)
Figure 60 Adding OpenFlow Switch
213