Class AdminReply

    • Constructor Detail

      • AdminReply

        public AdminReply​(boolean success,
                          String info)
        Constructs an AdminReply instance.
        Parameters:
        success - true if this reply replies to a successful request.
        info - Information to carry.
      • AdminReply

        public AdminReply​(int errorCode,
                          String info)
        Constructs an AdminReply instance for simple error cases.
        Parameters:
        errorCode - error code defining the type of the error
        info - Information to carry.
      • AdminReply

        public AdminReply()
    • Method Detail

      • succeeded

        public final boolean succeeded()
        Returns true if this reply replies to a successful request.
        Returns:
        true if this reply replies to a successful request.
      • getInfo

        public final String getInfo()
        Returns the carried info.
        Returns:
        the carried info.
      • getErrorCode

        public final int getErrorCode()
        Returns the error code.
        Returns:
        the error code.
      • writeTo

        public void writeTo​(OutputStream os)
                     throws IOException
        Description copied from interface: Streamable
        The object implements the writeTo method to write its contents to the output stream.
        Parameters:
        os - the stream to write the object to
        Throws:
        IOException - an error occurs during IO operation.
      • readFrom

        public void readFrom​(InputStream is)
                      throws IOException
        Description copied from interface: Streamable
        The object implements the readFrom method to restore its contents from the input stream.
        Parameters:
        is - the stream to read data from in order to restore the object
        Throws:
        IOException - an error occurs during IO operation.