Class ReturnWrapperImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      ReturnWrapperImpl​(org.zeromq.ZContext zContext, java.lang.Object[] decodedReceivedMessage, java.util.Map<java.lang.Long,​org.zeromq.ZMQ.Socket> socketMap)
      Construct a new ReturnWrapper.
    • Constructor Detail

      • ReturnWrapperImpl

        public ReturnWrapperImpl​(org.zeromq.ZContext zContext,
                                 java.lang.Object[] decodedReceivedMessage,
                                 java.util.Map<java.lang.Long,​org.zeromq.ZMQ.Socket> socketMap)
        Construct a new ReturnWrapper.
        Parameters:
        zContext - ZContext; the ZContext needed to create sockets for returned messages
        decodedReceivedMessage - Object[]; decoded Sim0MQ message
        socketMap - Map<Long, ZMQ.Socket>; cache of created sockets for returned messages
    • Method Detail

      • sendToMaster

        public void sendToMaster​(byte[] data)
        Central portal to send a message to the master.
        Parameters:
        data - byte[]; the data to send
      • encodeReplyAndTransmit

        public void encodeReplyAndTransmit​(java.lang.Boolean ackNack,
                                           java.lang.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.
        Specified by:
        encodeReplyAndTransmit in interface ReturnWrapper
        Parameters:
        ackNack - 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object