The Java API implements
the DataHubConnector class as the
basic class used to communicate with the Cascade DataHub.
Programmers writing stand-alone applications need only the
DataHubConnector and DataHubPoint classes.
Java Class Overview
The following classes are included in the Java API
installation. They are informally arranged here to give some
idea of the interrelationships:
Classes used for general programming
Classes used for web programming
DataHubBaseApplet is the applet that makes connections to the
DataHub. It provides access to all the data in a
single domain. There need be only one
DataHubBaseApplet per HTML page,
because indivual connections are made using
DataHubListener (see below). The
following two classes extend the
DataHubBaseApplet class:
- DataHubViewer displays a table of all the data in the domain.
It implements
DataHubEventConsumer.
- DataHubLink is used to instantiate a
DataHubBaseApplet for
supporting DataHubListener
widgets. It embeds a small text message "Powered by
Cogent" in the page.
DataHubListener is an applet that gets data from a specific point
or points in the DataHub. It is a parasite in the
sense that it relies on the connection to the DataHub
provided by a DataHubBaseApplet.
You can use any number of
DataHubListeners per HTML page,
without noticably affecting the rate of data throughput
to the page. The following three widgets are extended
from DataHubListener:
- DataHubButton toggles a DataHub point between two
values.
- DataHubEntryField is an entry field for changing the value of a DataHub
point.
- DataHubLabel displays the value of a DataHub
point.
- DataHubDummy is provided as a convenience to the HTML
programmer.
For internal use
- DataHubRendezvous provides a meeting point for the
DataHubBaseApplet and all of the
DataHubListener widgets on the
page. It is for internal use, providing static data
that gets initialized before any applet starts, giving
all the applets a means of finding one another.
Import Statements
import cogent.*;
or
import cogent.DataHubConnector;
import cogent.DataHubPoint;