23 #include "ocilibcpp/types.hpp" 39 Acquire(pMessage,
nullptr,
nullptr, parent);
48 inline Object Message::GetPayload<Object>()
54 inline void Message::SetPayload<Object>(
const Object &value)
60 inline Raw Message::GetPayload<Raw>()
62 unsigned int size = 0;
72 inline void Message::SetPayload<Raw>(
const Raw &value)
74 const AnyPointer data = value.empty() ? nullptr :
static_cast<AnyPointer>(
const_cast<Raw::value_type*
>(&value[0])) ;
96 unsigned int size = OCI_SIZE_BUFFER;
137 unsigned int size = OCI_SIZE_BUFFER;
148 const AnyPointer data = value.empty() ? nullptr :
static_cast<AnyPointer>(
const_cast<Raw::value_type*
>(&value[0])) ;
185 const size_t size = agents.size();
190 for (
size_t i = 0; i < size; ++i)
192 pAgents[i] =
static_cast<const Agent &
>(agents[i]);
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Internal usage. Interface for handling ownership and relationship of a C API handle.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetSender(OCI_Msg *msg, OCI_Agent *sender)
Set the original sender of a message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetEnqueueDelay(OCI_Msg *msg, int value)
set the number of seconds to delay the enqueued message
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgGetRaw(OCI_Msg *msg, void *raw, unsigned int *size)
Get the RAW payload of the given message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetExceptionQueue(OCI_Msg *msg, const otext *queue)
Set the name of the queue to which the message is moved to if it cannot be processed successfully...
Raw MakeRaw(AnyPointer result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
OCI_SYM_PUBLIC OCI_Agent *OCI_API OCI_MsgGetSender(OCI_Msg *msg)
Return the original sender of a message.
OCI_SYM_PUBLIC OCI_Date *OCI_API OCI_MsgGetEnqueueTime(OCI_Msg *msg)
return the time the message was enqueued
void SetExceptionQueue(const ostring &value)
Set the name of the queue to which the message is moved to if it cannot be processed successfully...
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
AQ identified agent for messages delivery.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetRaw(OCI_Msg *msg, const void *raw, unsigned int size)
Set the RAW payload of the given message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetCorrelation(OCI_Msg *msg, const otext *correlation)
set the correlation identifier of the message
int GetPriority() const
Return the priority of the message.
void Reset()
Reset all attributes of the message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetObject(OCI_Msg *msg, OCI_Object *obj)
Set the object payload of the given message.
OCI_SYM_PUBLIC OCI_Msg *OCI_API OCI_MsgCreate(OCI_TypeInfo *typinf)
Create a message object based on the given payload type.
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgFree(OCI_Msg *msg)
Free a message object.
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_MsgGetObject(OCI_Msg *msg)
Get the object payload of the given message.
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
ostring GetExceptionQueue() const
Get the Exception queue name of the message.
OCI_SYM_PUBLIC const otext *OCI_API OCI_MsgGetCorrelation(OCI_Msg *msg)
Get the correlation identifier of the message.
OCI_SYM_PUBLIC const otext *OCI_API OCI_MsgGetExceptionQueue(OCI_Msg *msg)
Get the Exception queue name of the message.
void SetCorrelation(const ostring &value)
Set the correlation identifier of the message.
void * AnyPointer
Alias for the generic void pointer.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
void SetPriority(int value)
Set the priority of the message.
Internal usage. Provide a buffer class with RAII capabilities.
Message(const TypeInfo &typeInfo)
Create a message object based on the given payload type.
OCI_SYM_PUBLIC int OCI_API OCI_MsgGetEnqueueDelay(OCI_Msg *msg)
Return the number of seconds that a message is delayed for dequeuing.
MessageState GetState() const
Return the state of the message at the time of the dequeue.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetConsumers(OCI_Msg *msg, OCI_Agent **consumers, unsigned int count)
Set the recipient list of a message to enqueue.
OCI_SYM_PUBLIC int OCI_API OCI_MsgGetPriority(OCI_Msg *msg)
Return the priority of the message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgGetOriginalID(OCI_Msg *msg, void *id, unsigned int *len)
Return the original ID of the message in the last queue that generated this message.
void SetOriginalID(const Raw &value)
Set the original ID of the message in the last queue that generated this message. ...
ostring GetCorrelation() const
Get the correlation identifier of the message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetPriority(OCI_Msg *msg, int value)
Set the priority of the message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgGetID(OCI_Msg *msg, void *id, unsigned int *len)
Return the ID of the message.
void SetConsumers(std::vector< Agent > &agents)
Set the recipient list of a message to enqueue.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgReset(OCI_Msg *msg)
Reset all attributes of a message object.
OCI_SYM_PUBLIC int OCI_API OCI_MsgGetExpiration(OCI_Msg *msg)
Return the duration that the message is available for dequeuing.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Agent GetSender() const
Return the original sender of the message.
Raw GetID() const
Return the ID of the message.
Provides type information on Oracle Database objects.
int GetEnqueueDelay() const
Return the number of seconds that a message is delayed for dequeuing.
void SetSender(const Agent &agent)
Set the original sender of the message.
void SetEnqueueDelay(int value)
set the number of seconds to delay the enqueued message
OCI_SYM_PUBLIC unsigned int OCI_API OCI_MsgGetState(OCI_Msg *msg)
Return the state of the message at the time of the dequeue.
void SetExpiration(int value)
set the duration that the message is available for dequeuing
OCI_SYM_PUBLIC int OCI_API OCI_MsgGetAttemptCount(OCI_Msg *msg)
Return the number of attempts that have been made to dequeue the message.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetOriginalID(OCI_Msg *msg, const void *id, unsigned int len)
Set the original ID of the message in the last queue that generated this message. ...
Date GetEnqueueTime() const
return the time the message was enqueued
int GetAttemptCount() const
Return the number of attempts that have been made to dequeue the message.
int GetExpiration() const
Return the duration that the message is available for dequeuing.
core::Enum< MessageStateValues > MessageState
Message state.
Object identifying the SQL data type OBJECT.
Raw GetOriginalID() const
Return the original ID of the message in the last queue that generated this message.
OCI_SYM_PUBLIC boolean OCI_API OCI_MsgSetExpiration(OCI_Msg *msg, int value)
set the duration that the message is available for dequeuing
Object identifying the SQL data type DATE.