public interface AQMessage
AQFactory.createAQMessage| Modifier and Type | Method and Description |
|---|---|
ANYDATA |
getANYDATAPayload()
Retrieves the payload as an ANYDATA.
|
byte[] |
getMessageId()
Gets the id (16 bytes) of this message.
|
AQMessageProperties |
getMessageProperties()
Gets the AQMessageProperties that goes with this AQMessage.
|
byte[] |
getPayload()
Retrieves the payload in its linearized form.
|
byte[] |
getPayloadTOID()
Retrieves the TOID of the payload.
|
RAW |
getRAWPayload()
Retrieves the payload as a RAW.
|
Struct |
getStructPayload()
Retrieves the payload as java.sql.Struct
|
STRUCT |
getSTRUCTPayload()
Retrieves the payload as an ADT.
|
oracle.xdb.XMLType |
getXMLTypePayload()
Retrieves the payload as an XMLType.
|
boolean |
isANYDATAPayload()
Returns true if the payload type is ANYDATA and false otherwise.
|
boolean |
isRAWPayload()
Returns trus if the payload type is RAW and false otherwise.
|
boolean |
isSTRUCTPayload()
Returns true if the payload is a STRUCT (in other words if the payload is an object) and false otherwise.
|
boolean |
isXMLTypePayload()
Returns trus if the payload type is XMLType and false otherwise.
|
void |
setPayload(ANYDATA payload)
Sets an ANYDATA payload.
|
void |
setPayload(byte[] payload)
Sets a RAW payload.
|
void |
setPayload(byte[] payload, byte[] tdo)
Sets the payload in its linearized form.
|
void |
setPayload(RAW payload)
Sets a RAW payload.
|
void |
setPayload(Struct payload)
Sets an ADT payload.
|
void |
setPayload(STRUCT payload)
Sets an ADT payload.
|
void |
setPayload(oracle.xdb.XMLType xmlt)
Sets an XMLType payload.
|
String |
toString()
Returns the String description of this message.
|
byte[] getMessageId()
throws SQLException
There are enqueue and dequeue options to retrieve the id of a message after enqueue or dequeue.
SQLExceptionAQMessageProperties getMessageProperties() throws SQLException
SQLExceptionvoid setPayload(byte[] payload)
throws SQLException
Sets the payload 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);
SQLExceptionvoid setPayload(byte[] payload,
byte[] tdo)
throws SQLException
This method lets you set the payload in its linearized form. You need to provide the correpondant 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 as
message.setPayload(payloadInBytes,TypeDescriptor.RAWTOID);
SQLExceptionvoid setPayload(Struct payload) throws SQLException
SQLExceptionvoid setPayload(STRUCT payload) throws SQLException
SQLExceptionvoid setPayload(ANYDATA payload) throws SQLException
SQLExceptionvoid setPayload(RAW payload) throws SQLException
SQLExceptionvoid setPayload(oracle.xdb.XMLType xmlt)
throws SQLException
SQLExceptionbyte[] getPayload()
throws SQLException
SQLExceptionbyte[] getPayloadTOID()
STRUCT getSTRUCTPayload() throws SQLException
SQLExceptionStruct getStructPayload() throws SQLException
SQLExceptionboolean isSTRUCTPayload()
throws SQLException
If the payload is q STRUCT, you should use getSTRUCTPayload() to get its value.
SQLExceptionANYDATA getANYDATAPayload() throws SQLException
SQLExceptionboolean isANYDATAPayload()
throws SQLException
If the payload type is ANYDATA, you should use getANYDATAPayload() to get its content.
SQLExceptionRAW getRAWPayload() throws SQLException
SQLExceptionboolean isRAWPayload()
throws SQLException
If the payload type is RAW, you should use getRAWPayload() to get its content.
SQLExceptionoracle.xdb.XMLType getXMLTypePayload()
throws SQLException
SQLExceptionboolean isXMLTypePayload()
throws SQLException
If the payload type is XMLType, you should use getXMLTypePayload() to get its content.
SQLException