Class MessageTrackerHubConnector

  • All Implemented Interfaces:
    ClientTransmissionHolder

    public class MessageTrackerHubConnector
    extends GuiHubConnector
    implements ClientTransmissionHolder
    HubConnector implementation which provides facilities for keeping track of incoming and outgoing messages as well as the other GUI features.
    Since:
    26 Nov 2008
    Author:
    Mark Taylor
    • Field Detail

      • callAllMap_

        private final java.util.Map callAllMap_
      • txModelMap_

        private final java.util.Map txModelMap_
      • rxModelMap_

        private final java.util.Map rxModelMap_
      • transListListener_

        private final javax.swing.event.ListDataListener transListListener_
      • listRemoveDelay_

        private final int listRemoveDelay_
      • logger_

        private static final java.util.logging.Logger logger_
    • Constructor Detail

      • MessageTrackerHubConnector

        public MessageTrackerHubConnector​(ClientProfile profile)
        Constructs a hub connector with default message tracker GUI expiry times.
        Parameters:
        profile - profile implementation
      • MessageTrackerHubConnector

        public MessageTrackerHubConnector​(ClientProfile profile,
                                          int listRemoveDelay,
                                          int tableRemoveDelay,
                                          int tableMaxRows)
        Constructs a hub connector with specified message tracker GUI expiry times. The delay times are times in milliseconds after message resolution before message representations expire and hence remove themselves from gui components.
        Parameters:
        profile - profile implementation
        listRemoveDelay - expiry delay for summary icons in client list display
        tableRemoveDelay - expiry delay for rows in message table display
        tableMaxRows - maximum number of rows in message table (beyond this limit resolved messages may be removed early)
    • Method Detail

      • getTxListModel

        public javax.swing.ListModel getTxListModel()
        Returns a ListModel representing the pending messages sent using this connector. Elements of the model are Transmission objects.
        Returns:
        transmission list model
      • getRxListModel

        public javax.swing.ListModel getRxListModel()
        Returns a ListModel representing the pending messages received using this connector. Elements of the model are Transmission objects.
        Returns:
        transmission list model
      • createMessageBox

        public javax.swing.JComponent createMessageBox​(int iconSize)
        Returns a component which displays messages currently being sent/received by this connector.
        Returns:
        iconSize height of icons in box
      • createMessageBox

        public static javax.swing.JComponent createMessageBox​(int iconSize,
                                                              javax.swing.ListModel rxListModel,
                                                              javax.swing.ListModel txListModel)
        Returns a component which displays messages in receiver and/or sender list models.
        Parameters:
        iconSize - height of icons
        rxListModel - list model containing received Transmission objects
        txListModel - list model containing sent Transmission objects
      • createMonitorPanel

        public javax.swing.JComponent createMonitorPanel()
        Description copied from class: GuiHubConnector
        Returns a new component which displays status for this connector.
        Overrides:
        createMonitorPanel in class GuiHubConnector
        Returns:
        new hub connection monitor component
      • scheduleAddTransmission

        private void scheduleAddTransmission​(Transmission trans,
                                             boolean tx)
        Schedules a new transmission to add to the appropriate list models. May be called from any thread.
        Parameters:
        trans - transmission
        tx - true for send, false for receive
      • scheduleSetResponse

        private void scheduleSetResponse​(Transmission trans,
                                         Response response)
        Schedules a response to be registered for a previously added transmission. May be called from any thread.
        Parameters:
        trans - transmission
        response - response to associated with trans
      • scheduleSetFailure

        private void scheduleSetFailure​(Transmission trans,
                                        java.lang.Throwable error)
        Schedules an error to be registered for a previously added transmission. May be called from any thread.
        Parameters:
        trans - transmission
        error - exception