Attaching the NAC plugin to OpenDaylight

This application uses the Activator class to attach itself to OpenDaylight. This class creates an Activator class that is extended from org.OpenDaylight.controller.sal.core.ComponentActivatorAbstractBase.

As we discussed in previous chapters, OpenDaylight is based on Apache Karaf OSGi container. The NAC plugin is an OSGi component, and in order to implement this, we need two other class files:

  • OSGi activator: This is to register the component with the OSGi framework.
  • PacketHandler: This is the control logic to process the packets in the event of packet-in and when the packets are handed over to PacketHandler.

Lets have a closer look at the Activator.java source code :

 01 package ca.inverse.odlpf; ...

Get Learning OpenDaylight now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.