Package com.bytedesk.call.mrcp4j.message
Class MrcpMessage
java.lang.Object
com.bytedesk.call.mrcp4j.message.MrcpMessage
- Direct Known Subclasses:
MrcpRequest,MrcpServerMessage
- Author:
- Niels Godfredsen <ngodfredsen@users.sourceforge.net>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHeader(MrcpHeader header) protected abstract StringBuilderTODOCgetHeader(MrcpHeaderName name) intlongbooleanvoidTODOCremoveHeader(MrcpHeaderName name) removeHeader(String name) voidsetContent(String content) Method for setting the content of the message if the content type, id and length headers have already been set.voidsetContent(String contentType, String contentId, String content) Sets the content for the body of the message as well as any applicable headers.voidsetContent(String contentType, String contentId, URL content) Sets the content for the body of the message as well as any applicable headers.voidsetMessageLength(int messageLength) voidsetRequestID(long requestID) voidsetVersion(String version) toString()
-
Field Details
-
CRLF
- See Also:
-
MRCP_VERSION_2_0
- See Also:
-
_version
-
_messageLength
private int _messageLength -
_requestID
private long _requestID -
_headers
-
_content
-
-
Constructor Details
-
MrcpMessage
public MrcpMessage()
-
-
Method Details
-
setVersion
-
getVersion
-
setMessageLength
public void setMessageLength(int messageLength) -
getMessageLength
public int getMessageLength() -
setRequestID
public void setRequestID(long requestID) -
getRequestID
public long getRequestID() -
addHeader
-
getHeader
-
getHeader
-
removeHeader
-
removeHeader
-
getHeaders
-
setContent
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
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, useremoveContent()method to remove previously set content.)
-
removeContent
public void removeContent()TODOC -
setContent
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
TODOC- Returns:
- Returns the content.
-
getContentType
- Returns:
- the type of the content of the message or null if not set.
-
getChannelIdentifier
- 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
-
appendStartLine
-