Class MrcpMessage

java.lang.Object
com.bytedesk.call.mrcp4j.message.MrcpMessage
Direct Known Subclasses:
MrcpRequest, MrcpServerMessage

public abstract class MrcpMessage extends Object
Author:
Niels Godfredsen <ngodfredsen@users.sourceforge.net>
  • Field Details

  • Constructor Details

    • MrcpMessage

      public MrcpMessage()
  • Method Details

    • setVersion

      public void setVersion(String version)
    • getVersion

      public String getVersion()
    • setMessageLength

      public void setMessageLength(int messageLength)
    • getMessageLength

      public int getMessageLength()
    • setRequestID

      public void setRequestID(long requestID)
    • getRequestID

      public long getRequestID()
    • addHeader

      public void addHeader(MrcpHeader header)
    • getHeader

      public MrcpHeader getHeader(MrcpHeaderName name)
    • getHeader

      public MrcpHeader getHeader(String name)
    • removeHeader

      public MrcpHeader removeHeader(MrcpHeaderName name)
    • removeHeader

      public MrcpHeader removeHeader(String name)
    • getHeaders

      public Collection<MrcpHeader> getHeaders()
    • setContent

      public void setContent(String contentType, String contentId, URL content) throws IOException
      Sets the content for the body of the message as well as any applicable headers.
      Parameters:
      contentType - the MIME type of the content. (required)
      contentId - the ID of the content. (optional)
      content - the body of the message. (required)
      Throws:
      IOException - if the URL cannot be opened
    • setContent

      public void setContent(String contentType, String contentId, String content)
      Sets the content for the body of the message as well as any applicable headers.
      Parameters:
      contentType - the MIME type of the content. (required)
      contentId - the ID of the content. (optional)
      content - the body of the message. (required, use removeContent() method to remove previously set content.)
    • removeContent

      public void removeContent()
      TODOC
    • setContent

      public void setContent(String content)
      Method for setting the content of the message if the content type, id and length headers have already been set. Provided primarly for use while decoding messages objects from a MRCP message stream. MRCP4J clients generally should not use this method.
      Parameters:
      content - the body of the message.
    • hasContent

      public boolean hasContent()
      Returns:
      true if this message has content in the body of the message.
    • getContent

      public String getContent()
      TODOC
      Returns:
      Returns the content.
    • getContentType

      public String getContentType()
      Returns:
      the type of the content of the message or null if not set.
    • getChannelIdentifier

      public ChannelIdentifier getChannelIdentifier() throws IllegalValueException
      Returns:
      the channel identifier associated with this message or null if it has not been set or was set with an invalid value.
      Throws:
      IllegalValueException - if an illegal value has been specified for the channel-identifier header.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • appendStartLine

      protected abstract StringBuilder appendStartLine(StringBuilder sb)