Data inputs
For a publisher to be able to publish data to clients it must have a source for that data.
The data can be obtained from some type of feed, perhaps provided by some external API or it can be from some other application communicating using Diffusion™ protocols. This is entirely up to the publisher but Diffusion does offer some mechanisms.
DEPRECATED: Server connections
A publisher can receive its data from another publisher in a distributed environment as if it were a client of that publisher. To do this it is necessary for the publisher to connect to the server of the remote publisher and subscribe to its topics.
Connection to remote servers can be set up automatically for a publisher by configuring the connection in etc/Publishers.xml. A reference to such a server connection can be obtained by the publisher using the getServerConnection method or all connections van be obtained using getServerConnections.
Alternatively, a publisher can explicitly connect to remote servers using addServerConnection.
However the connection is made, the publisher is notified of the connection via the serverConnected method.
If a server connection is closed by the remote server or lost the publisher is notified through the serverDisconnected method.
Once a serverConnection is established the publisher must subscribe to topics on it and receive topic messages through the messageFromServer method. Typically, the first such method is a load message providing the initial state for the topic. Processing of the messages can be done within this method or alternatively the publisher can specify topic listeners to handle the messages on a per topic basis.
Control clients
A publisher can receive input from a control client.
Control clients can use the TopicUpdateControl feature to publish messages to topics. Where such topics have topic data the topic state is automatically updated and deltas are published to subscribed clients. Where topics do not have topic data, published messages are forwarded to subscribed clients (that is, it is assumed that the control client maintains the data state).
Control clients can also send messages to specific clients and these are forwarded to the clients automatically.