Interface ReturnWrapper

  • All Known Implementing Classes:
    ReturnWrapperImpl

    public interface ReturnWrapper
    The ReturnWrapper interface enforces implementation of the encodeReplyAndTransmit method

    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
    • Method Detail

      • encodeReplyAndTransmit

        void encodeReplyAndTransmit​(Boolean status,
                                    Object[] payload)
                             throws Sim0MQException,
                                    SerializationException
        Encode a String reply and transmit it while patching the message type id field by adding a vertical bar and a suffix.
        Parameters:
        status - Boolean; if null, the payload is transmitted as is; if true, a boolean true is prepended to the payload; if false, a boolean false is prepended to the payload
        payload - Object []; payload of the reply message
        Throws:
        Sim0MQException - not sure if that can happen
        SerializationException - when an object in payload cannot be serialized
      • encodeReplyAndTransmit

        default void encodeReplyAndTransmit​(Boolean status,
                                            String payload)
                                     throws Sim0MQException,
                                            SerializationException
        Encode a String reply and transmit it.
        Parameters:
        status - Boolean; if null, the payload is transmitted as is; if true, a boolean true is prepended to the payload; if false, a boolean false is prepended to the payload
        payload - String; payload of the reply message
        Throws:
        Sim0MQException - not sure if that can happen
        SerializationException - when an object in payload cannot be serialized