Interface AQMessage
- See Also:
-
AQFactory.createAQMessage
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the payload as an ANYDATA.Retrieves the payload as JSON type.byte[]Gets the id (16 bytes) of this message.Gets the AQMessageProperties that goes with this AQMessage.byte[]Retrieves the payload in its linearized form.byte[]Retrieves the TOID of the payload.Retrieves the payload as a RAW.getStructPayload(Connection conn) Retrieves the payload as java.sql.StructRetrieves the payload as an ADT.getSTRUCTPayload(Connection conn) oracle.xdb.XMLTypeRetrieves the payload as an XMLType.booleanReturns true if the payload type is ANYDATA and false otherwise.booleanReturns true if the payload type is JSON, false otherwise.booleanReturns true if the payload type is RAW and false otherwise.booleanReturns true if the payload is a STRUCT (in other words if the payload is an object) and false otherwise.booleanReturns true if the payload type is XMLType and false otherwise.voidsetPayload(byte[] payload) Sets a RAW payload.voidsetPayload(byte[] payload, byte[] tdo) Sets the payload in its linearized form.voidsetPayload(Struct payload) Sets an ADT payload.voidsetPayload(ANYDATA payload) Sets an ANYDATA payload.voidsetPayload(OracleJsonDatum jsonPayload) Sets JSON type payload.voidsetPayload(RAW payload) Sets a RAW payload.voidsetPayload(STRUCT payload) Sets an ADT payload.voidsetPayload(oracle.xdb.XMLType xmlt) Sets an XMLType payload.toString()Returns the String description of this message.
-
Method Details
-
getMessageId
Gets the id (16 bytes) of this message.There are enqueue and dequeue options to retrieve the id of a message after enqueue or dequeue.
- Throws:
SQLException
-
getMessageProperties
Gets the AQMessageProperties that goes with this AQMessage.- Throws:
SQLException
-
setPayload
Sets a RAW payload.Sets the payload type to "RAW" and stores the given payload but doesn't make a copy.
Calling this method is the equivalent of:
// payloadInBytes being the byte[] array RAW rawPayload = new RAW(payloadInBytes); message.setPayload(rawPayload);- Throws:
SQLException
-
setPayload
Sets the payload in its linearized form.This method lets you set the payload in its linearized form. You need to provide the correponding OID of the Type Descriptor Object. This is useful in the case where you have your own pickler.
For example, given that the linearized form of a RAW instance is the bytes themselves, the following code:
message.setPayload(payloadInBytes);
is the same asmessage.setPayload(payloadInBytes,TypeDescriptor.RAWTOID);
- Throws:
SQLException
-
setPayload
Sets an ADT payload.- Throws:
SQLException
-
setPayload
Sets an ADT payload.- Throws:
SQLException
-
setPayload
Sets an ANYDATA payload.- Throws:
SQLException
-
setPayload
Sets a RAW payload.- Throws:
SQLException
-
setPayload
Sets an XMLType payload.- Throws:
SQLException
-
setPayload
Sets JSON type payload.- Parameters:
jsonPayload- json type payload.- Throws:
SQLException
-
getPayload
Retrieves the payload in its linearized form.- Throws:
SQLException
-
getPayloadTOID
byte[] getPayloadTOID()Retrieves the TOID of the payload. -
getSTRUCTPayload
Retrieves the payload as an ADT.- Throws:
SQLException
-
getSTRUCTPayload
- Throws:
SQLException
-
getStructPayload
Retrieves the payload as java.sql.Struct- Throws:
SQLException
-
getStructPayload
- Throws:
SQLException
-
isSTRUCTPayload
Returns true if the payload is a STRUCT (in other words if the payload is an object) and false otherwise.If the payload is q STRUCT, you should use
getSTRUCTPayload()to get its value.- Throws:
SQLException
-
getANYDATAPayload
Retrieves the payload as an ANYDATA.- Throws:
SQLException
-
isANYDATAPayload
Returns true if the payload type is ANYDATA and false otherwise.If the payload type is ANYDATA, you should use
getANYDATAPayload()to get its content.- Throws:
SQLException
-
getRAWPayload
Retrieves the payload as a RAW.- Throws:
SQLException
-
isRAWPayload
Returns true if the payload type is RAW and false otherwise.If the payload type is RAW, you should use
getRAWPayload()to get its content.- Throws:
SQLException
-
getXMLTypePayload
Retrieves the payload as an XMLType.- Throws:
SQLException
-
isXMLTypePayload
Returns true if the payload type is XMLType and false otherwise.If the payload type is XMLType, you should use
getXMLTypePayload()to get its content.- Throws:
SQLException
-
getJSONPayload
Retrieves the payload as JSON type.- Returns:
- JSON type payload
- Throws:
SQLException
-
isJSONPayload
Returns true if the payload type is JSON, false otherwise.If the payload type is JSON, you should use
getJSONPayload()to get its content.- Returns:
- true if the payload type is JSON, false otherwise.
- Throws:
SQLException
-
toString
String toString()Returns the String description of this message.
-