NcML AIS: Build a BES Handler

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽

Back: AIS Using NcML

A UML Class diagram for a Simple BES Handler

There are several ways to build a shell BES handler and then add specific functionality to it. One way is to use the besCreadeModule script that is included in the BES source code. A second way is to copy and modify the csv handler software that's also included in the BES source code. In each case it's important to know that the BES is an object-oriented framework and as such, you will be specializing classes that the framework defines and then adding new classes and/or functions that are specific to your handler. With that in mind a static class diagram can help show how the BES's classes are related to each other and to the software you must write. Shown to the left is a UML class diagram that includes the most important of the BES classes when writing a new data handler.

A high resolution version of the class diagram to the right.

Also, be sure to look over hte BES documentation files included on this design's main page and on in the Hyrax documentation. Especially useful is the BES Handler tutorial that covers building the Hello, World and CSV handlers. It's so useful I'll repeat it here: Extending the OLFS: Writing Custom Dispatch Handlers.

Explanation of the Classes in the Diagram

Basic operation of the BES Framework

The BES is a daemon that waits for connections and, when one is detected, reads the commands and executes the appropriate methods in either the BES framework or one of the handlers that are loaded into the BES during initialization. In a very general sense, the BES follows this workflow:

  • Parse the command associate with the current request
  • Decide which handler should be used to satisfy the request
  • Use the handler to build a response
  • Return the response

It's possible to define new commands and new ways of transmitting data for various protocols, but those uses of the BES are beyond what a simple data handler that works with Hyrax needs. A data handler to be used with Hyrax that only needs to support the basic BES command (e.g., show version), the DAP commands and return responses using HTTP, does not need to specialize the command set, the response types or the transmitter classes.

Classes that are Provided

In the diagram, all of the classes whose names start with BES are part of the BES framework. You don't have to write anything to use them and for several, you don't even have to directly use them at all and instead just need to know they exist.

For all of the classes listed below, I'll mention which two require specialization here and in a following section, where the specialization will be described in detail. Note that all of the BES classes have BESObj as a parent, so all can passed using a pointer to a BESObj.

BESCommandInterface
Used to pass information from a method you've written in a child of BESRequestHandler to a response handler
BESResponseHandler
This class builds a BESResponseObject and then transmits it.
BESDapResponseObject and the various children
These holds specific types of responses for the DAP
BESTransmitter
Used by BESResponseHandler to transmit a ResponseObject. For DAP, the BESBasicHttpTransmitter class is actually used.
BESCatalog
A catalog is a way of getting listings (catalogs) of things
BESCatalogDirecotry
A catalog for a disk directory. This is used to build the Hyrax server's directory pages.
BESCatalogList
This class is used to for a list that the BES searches when it needs to find a specific catalog that's mentioned in a command. It's one of the singleton objects discussed later
BESContainerStorageCatalog
Not really sure...
BESContainerStorageList
A list of ...

Classes that must be Specialized

BES Framework Singleton Objects

Putting it all Together