Class ConnectionMessage
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.ConnectionMessage
-
- All Implemented Interfaces:
AutoCloseable
public final class ConnectionMessage extends Object implements AutoCloseable
ConnectionMessage represents implementation specific messages sent to and received from the speech service. These messages are provided for debugging purposes and should not be used for production use cases with the Azure Cognitive Services Speech Service. Messages sent to and received from the Speech Service are subject to change without notice. This includes message contents, headers, payloads, ordering, etc. Note: close() must be called in order to release underlying resources held by the object. Added in version 1.15.0.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Explicitly frees any external resource attached to the object.byte[]getBinaryMessage()Gets the binary message payload.StringgetPath()The message PathPropertyCollectiongetProperties()A collection of properties and their values defined for this ConnectionMessage.StringgetTextMessage()Gets the text message payload.booleanisBinaryMessage()Checks to see if the ConnectionMessage is a binary message.booleanisTextMessage()Checks to see if the ConnectionMessage is a text message.StringtoString()Returns a string that represents the connection message.
-
-
-
Method Detail
-
getPath
public String getPath()
The message Path- Returns:
- A string that specifies the message type.
-
getTextMessage
public String getTextMessage()
Gets the text message payload. Typically the text message content-type is application/json. To determine other content-types use Properties.GetProperty("Content-Type").- Returns:
- A string containing the text message.
-
getBinaryMessage
public byte[] getBinaryMessage()
Gets the binary message payload.- Returns:
- An array of bytes containing the binary message.
-
isBinaryMessage
public boolean isBinaryMessage()
Checks to see if the ConnectionMessage is a binary message. See also GetBinaryMessage().- Returns:
- A boolean indicated if the message payload is binary.
-
isTextMessage
public boolean isTextMessage()
Checks to see if the ConnectionMessage is a text message. See also IsBinaryMessage().- Returns:
- A bool indicated if the message payload is text.
-
toString
public String toString()
Returns a string that represents the connection message.
-
getProperties
public PropertyCollection getProperties()
A collection of properties and their values defined for this ConnectionMessage. Message headers can be accessed via this collection (e.g. "Content-Type").- Returns:
- PropertyCollection
-
close
public void close()
Explicitly frees any external resource attached to the object. Note: close() must be called in order to release underlying resources held by the object.- Specified by:
closein interfaceAutoCloseable
-
-