Class Publisher

  • All Implemented Interfaces:
    Identifiable, TransceiverInterface

    public class Publisher
    extends AbstractTransceiver
    Publish all available transceivers for an OTS network to a Sim0MQ master and handle its requests.
    Example sequence of events:
    1. OTSNetwork is somehow constructed and then a Publisher for that network is constructed.
    2. Sim0MQ master requests names of all available subscription handlers
    3. Sim0MQ master decides that it wants all GTU MOVE events of all GTUs. To do that it needs to know about all GTUs when they are created and about all GTUs that have already been created. The Sim0MQ master issues to the publisher a request to subscribe to all NETWORK.GTU_ADD_EVENTs of the GTUs_in_network SubscriptionHandler
    4. This Publisher requests the GTUs_in_network SubscriptionHandler to subscribe to the add events. From now on, the GTUs_in_network SubscriptionHandler will receive these events generated by the OTSNetwork and transcribe those into a Sim0MQ events which are transmitted to the Sim0MQ master.
    5. Sim0MQ master requests publisher to list all the elements of the GTUs_in_network SubscriptionHandler
    6. This Publisher calls the list method of the GTUs_in_network SubscriptionHandler which results in a list of all active GTUs being sent to the Sim0MQ master
    7. The Sim0MQ master requests this Publisher to create a subscription for the update events of the GTU_move SubscriptionHandler, providing the GTU id as address. It does that once for every GTU id.
    8. This Publishers creates the subscriptions. From now on any GTU.MOVE_EVENT event is transcribed by the GTU_move SubscriptionHandler in to a corresponding Sim0MQ event and sent to the Sim0MQ master.

    Copyright (c) 2020-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    $LastChangedDate: 2020-02-13 11:08:16 +0100 (Thu, 13 Feb 2020) $, @version $Revision: 6383 $, by $Author: pknoppers $,

    Author:
    Alexander Verbraeck, Peter Knoppers
    • Constructor Detail

    • Method Detail

      • getIdSource

        public TransceiverInterface getIdSource​(int addressLevel,
                                                ReturnWrapper returnWrapper)
                                         throws Sim0MQException,
                                                SerializationException
        Retrieve the TransceiverInterface that can be used to get detailed information about a single object.
        Parameters:
        addressLevel - int; index of the argument in the address fields
        returnWrapper - ReturnWrapper; to be used to report problems
        Returns:
        TransceiverInterface; to be used to get valid values for argument addressLevel, or null if valid values for the argument at index addressLevel can not be obtained through a TransceiverInterface object
        Throws:
        Sim0MQException - when the ReturnWrapper fails
        SerializationException - when the ReturnWrapper fails
      • hasIdSource

        public boolean hasIdSource()
        Report if this transceiver has an id source.
        Returns:
        boolean; true if this transceiver has an id source; false if this transceiver does not have an id source