DEPRECATED: Server connections
Connecting to other Diffusion™ servers from within a publisher
Publishers can act as clients of other publishers for the purpose of distributed processing. In this case there is a client/server relationship between two publishers. One publisher can be a client of many other publishers and a publisher can have many publisher clients.
A publisher acting as the server in such a relationship sees the client as a normal client. The only thing distinguishing it is its client type (obtained using Client.getClientType).
However, for a publisher to act as the client of another publisher it must make an outbound connection to the Diffusion server that hosts the server publisher. In fact, the client publisher knows nothing of the server publisher, only the server and the topics it subscribes to, as if it were a normal client.
Server connections can be made automatically for a publisher by declaring them in etc/Publishers.xml. In this case the connections are made automatically during publisher startup. You can configure the behavior when such connections fail. It might cause the publisher to fail (if it is dependent upon the server as a data source) or it might allow the publisher to start but retry the connection periodically until it succeeds. Alternatively, it might do nothing.
Alternatively, the publisher can dynamically make server connections as, and when required. To do this it uses the addServerConnection method to create a PublisherServerConnection object, configure the connection as required and use the connect method on the object to make the connection
Whether server connections are made automatically or manually the publisher is notified when a connection is made using the serverConnected method and when the connection is closed or lost using the serverDisconnected method.
The publisher receives messages from server connections on the messageFromServer notification method.
The publisher is notified of the change of status (for example, removal) of any topics it is subscribed to at a server connection on the serverTopicStatusChanged notification method.