Class RequestMessage


  • public class RequestMessage
    extends java.lang.Object
    Represents a TraCI messages used to send Commands from the client to server (i.e. requests). After construction, the commands are appended one after one with append(Command). The whole message, along with its length header, can be then retrieved in a serialized form via the writeTo(DataOutputStream) method.
    Author:
    Enrico Gueli <enrico.gueli@polito.it>
    See Also:
    TraCI/Protocol#Messages
    • Constructor Summary

      Constructors 
      Constructor Description
      RequestMessage()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(Command c)
      Adds a command to the tail of this message.
      java.util.List<Command> commands()  
      void writeTo​(java.io.DataOutputStream dos)
      Writes the commands to the specified DataOutputStream object, in the same order as the calls of append(Command).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RequestMessage

        public RequestMessage()
    • Method Detail

      • append

        public void append​(Command c)
        Adds a command to the tail of this message.
        Parameters:
        c - c
        Throws:
        java.lang.NullPointerException - if the command is null.
      • writeTo

        public void writeTo​(java.io.DataOutputStream dos)
                     throws java.io.IOException
        Writes the commands to the specified DataOutputStream object, in the same order as the calls of append(Command).
        Parameters:
        dos - data output stream
        Throws:
        java.io.IOException - Exception
      • commands

        public java.util.List<Command> commands()