Reference Guide

Table Of Contents
Device: This object is maintained by Device Manager and contains a DeviceInfo object and other
information and status about the device. This object can be obtained by Applications using the
Device Service API.
DeviceHandler: This object contains a DeviceInfo object and the IP address of the device. This
object is used by Application to get Handler Facets.
Note: Ports/Interfaces are maintained as a separate entity associated to a device and are not
shown in the figure above.
Using the Device Driver Framework
Several Device Driver Framework components expose APIs that can be used by Applications. The
following APIs will typically be used by Applications:
Device Service: Applications can use APIs provided by this service to perform CRUD (Create,
Read, Update, and Delete) operations on devices and port-interfaces. Given a device object,
applications can obtain information about Facets, DeviceInfo and Device Handler objects.
Key Service: This Service API allows Applications to add keys, remove keys, and get security
keys maintained by the Key Manager.
Device Drive Service: This Service API allows Applications to create Device Handlers. Device
Handlers are needed to be able to get Handler Facets that are supported by a specific type of
device. Using a Device Handler to get Handler Facets is discussed below.
Device Model APIs
The java objects that represent Device information expose interfaces to allow Applications to
perform device related functions. For example, the Device object provides the method isOnline() to
determine if the device is online or offline. The Device object also provides the method info() to
obtain a DeviceInfo object. The DeviceInfo object provides an API to allow Application to list of all
Facets supported by the device, check if a Facet is supported, and get an instance of a Facet so
that the Facet can be used.
Facet Usage Example
The code sample below demonstrates the following:
How to get a Device object using the Device Service
How to get a DeviceInfo object using the Device object
How to check if a device is online
How to check if a Facet is supported by the device
How to get a Facet that is supported by the device
How to use the Facet to perform a function that is provided by the Facet
/**
* Validate and adjust the FlowMod passed to this method.
*
* @param ds reference to the DeviceService
* @param dpid DataPathId for the device the FlowMod is to be sent to.
121