Class InputChunks


  • public class InputChunks
    extends Object
    Represents one incoming MSRP message reassembled from multiple SEND MsrpRequest chunks.
    • Constructor Detail

      • InputChunks

        public InputChunks​(String messageId,
                           long maxContentLength)
        Constructor.
        Parameters:
        messageId - incoming message ID
        maxContentLength - maximum allowed message content length
        Throws:
        IllegalArgumentException - if messageId is null
    • Method Detail

      • handleSend

        public boolean handleSend​(MsrpRequest request)
                           throws ProtocolException
        Handle an incoming SEND request for this message. Also resets this instance's idle timer.
        Parameters:
        request - incoming SEND request associated with this message
        Returns:
        true if this message is now complete (or aborted); false if more chunks are still required
        Throws:
        IllegalArgumentException - if request is null
        IllegalArgumentException - if request is not a SEND request
        IllegalArgumentException - if request has the wrong message ID
        ProtocolException - if a protocol violation is detected
      • getIdleTime

        public long getIdleTime()
        Get idle time of this instance.
        Returns:
        time in milliseconds since (construction or) the most recent invocation of handleSend()
      • getMessageId

        public String getMessageId()
        Get message ID.
        Returns:
        message ID
      • getFromPath

        public List<MsrpUri> getFromPath()
        Get From path.
        Returns:
        from path
      • getContent

        public byte[] getContent()
        Get message content.
        Returns:
        message content, or null if this message does not contain any content
      • getContentType

        public String getContentType()
        Get message content type.
        Returns:
        message content type, or null if this message does not contain any content
      • getHeaders

        public SortedSet<Header> getHeaders()
        Get other headers, sorted by header name case-insensitively.
        Returns:
        other headers
      • isComplete

        public boolean isComplete()
        Determine whether this instance is complete.
        Returns:
        true if complete, otherwise false
      • isAborted

        public boolean isAborted()
        Determine whether this instance was aborted.
        Returns:
        true if aborted, otherwise false
      • isSuccessReport

        public boolean isSuccessReport()
        Determine whether this message requires a success report.
        Returns:
        true if this message requires a success report, otherwise false
      • getFailureReport

        public FailureReport getFailureReport()
        Determine what type of failure reporting this message requires.
        Returns:
        failure reporting requirement