A DTS ServerConnection class provides the connection from the client to the server. The DTS Editor client creates a ServerConnection using one of the implmentations such as ServerConnectionJDBC or ServerConnectionSocket. The particular ServerConnection established is then passed into the createInstance methods of the service class like SearchServer, NavServer, NamespaceQuery and ConceptDefQuery. When connection events take place the DTS Editor notifies the plug-in so that it can take appropriate actions such as enabling/disabling it's menu items.
{@link com.apelon.beans.dts.plugin.connection.DtsConnectionListener} defines the available Connection event methods that an interested class must implement for processing of Connection events. The methods defined by this interface must be implemented by any class required to perform an action when a Connection action occurs. connectionOpened(), connectionWillClose(), connectionClosing() and connectionClosed() all take an {@link com.apelon.beans.dts.plugin.connection.DtsConnectionEvent} object and need to be implemented with the appropriate actions to be taken upon the various events. {@link com.apelon.beans.dts.plugin.connection.DtsConnectionEvent} includes Static eventType options like CONNECTION_OPEN and CONNECTION_CLOSE that can be used to check for the type of event occurring.
The plug-in may want to check with the user before closing a connection and give them a 'veto' against the close. The details that can be supplied with the veto are contained in {@link com.apelon.beans.dts.plugin.connection.VetoCloseDescriptor}. Calling VetoCloseDescriptor() creates the veto details. These details are used by the application to determine whether to continue with the connection close. For example, DTSEditor uses this information in the confirmation dialog to get user input about connection close.
{@link com.apelon.beans.dts.plugin.connection.DtsConnectionAdapter} provides a default 'do nothing' implementation for {@link com.apelon.beans.dts.plugin.connection.DtsConnectionListener} methods. These include connectionOpened(), connectionWillClose(), connectionClosing() and connectionClosed() which all take {@link com.apelon.beans.dts.plugin.connection.DtsConnectionEvent}.