|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AQMessage
A message is the unit that is enqueued or dequeued. An AQMessage object holds both its content, or payload, and its properties. This class provides methods to get and set message properties and the payload.
AQFactory.createAQMessage
Method Summary | |
---|---|
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 an ADT. |
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. |
java.lang.String |
toString()
Returns the String description of this message. |
Method Detail |
---|
byte[] getMessageId() throws java.sql.SQLException
There are enqueue and dequeue options to retrieve the id of a message after enqueue or dequeue.
java.sql.SQLException
AQMessageProperties getMessageProperties() throws java.sql.SQLException
java.sql.SQLException
void setPayload(byte[] payload) throws java.sql.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);
java.sql.SQLException
void setPayload(byte[] payload, byte[] tdo) throws java.sql.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);
java.sql.SQLException
void setPayload(STRUCT payload) throws java.sql.SQLException
java.sql.SQLException
void setPayload(ANYDATA payload) throws java.sql.SQLException
java.sql.SQLException
void setPayload(RAW payload) throws java.sql.SQLException
java.sql.SQLException
byte[] getPayload() throws java.sql.SQLException
java.sql.SQLException
byte[] getPayloadTOID()
STRUCT getSTRUCTPayload() throws java.sql.SQLException
java.sql.SQLException
boolean isSTRUCTPayload() throws java.sql.SQLException
If the payload is q STRUCT, you should use getSTRUCTPayload()
to get its value.
java.sql.SQLException
ANYDATA getANYDATAPayload() throws java.sql.SQLException
java.sql.SQLException
boolean isANYDATAPayload() throws java.sql.SQLException
If the payload type is ANYDATA, you should use getANYDATAPayload()
to get its content.
java.sql.SQLException
RAW getRAWPayload() throws java.sql.SQLException
java.sql.SQLException
boolean isRAWPayload() throws java.sql.SQLException
If the payload type is RAW, you should use getRAWPayload()
to get its content.
java.sql.SQLException
XMLType getXMLTypePayload() throws java.sql.SQLException
java.sql.SQLException
boolean isXMLTypePayload() throws java.sql.SQLException
If the payload type is XMLType, you should use getXMLTypePayload()
to get its content.
java.sql.SQLException
java.lang.String toString()
toString
in class java.lang.Object
|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |