OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
ocilib::Enqueue Class Reference

Enqueue object for queuing messages into an Oracle Queue. More...

#include <types.hpp>

Inherits ocilib::core::HandleHolder< OCI_Enqueue * >.

Public Types

enum  EnqueueModeValues { Before = OCI_ASD_BEFORE , OnTop = OCI_ASD_TOP }
 Message enqueuing mode enumerated values. More...
 
enum  EnqueueVisibilityValues { Immediate = OCI_AMV_IMMEDIATE , OnCommit = OCI_AMV_ON_COMMIT }
 Message visibility enumerated values. More...
 
typedef core::Enum< EnqueueModeValuesEnqueueMode
 Message enqueuing mode.
 
typedef core::Enum< EnqueueVisibilityValuesEnqueueVisibility
 Message visibility after begin queued.
 

Public Member Functions

 Enqueue (const TypeInfo &typeInfo, const ostring &queueName)
 Create a Enqueue object for the given queue.
 
void Put (const Message &message)
 Enqueue a message the on queue associated to the Enqueue object.
 
EnqueueVisibility GetVisibility () const
 Get the enqueuing/locking behavior.
 
void SetVisibility (EnqueueVisibility value)
 Set whether the new message is enqueued as part of the current transaction.
 
EnqueueMode GetMode () const
 Return the enqueuing mode of messages to enqueue.
 
void SetMode (EnqueueMode value)
 Set the enqueuing mode of messages to put in the queue.
 
Raw GetRelativeMsgID () const
 Get the current associated message identifier used for enqueuing messages using a sequence deviation.
 
void SetRelativeMsgID (const Raw &value)
 Set a message identifier to use for enqueuing messages using a sequence deviation.
 

Detailed Description

Enqueue object for queuing messages into an Oracle Queue.

This class wraps the OCILIB object handle OCI_Enqueue and its related methods

Definition at line 7767 of file types.hpp.

Member Typedef Documentation

◆ EnqueueMode

Message enqueuing mode.

Possible values are Enqueue::EnqueueModeValues

Definition at line 7791 of file types.hpp.

◆ EnqueueVisibility

Message visibility after begin queued.

Possible values are Enqueue::EnqueueVisibilityValues

Definition at line 7813 of file types.hpp.

Member Enumeration Documentation

◆ EnqueueModeValues

Message enqueuing mode enumerated values.

Enumerator
Before 

Enqueue message before another message

OnTop 

Enqueue message before all messages

Definition at line 7776 of file types.hpp.

◆ EnqueueVisibilityValues

Message visibility enumerated values.

Enumerator
Immediate 

Enqueue is an independent transaction

OnCommit 

Enqueue is part of current transaction

Definition at line 7798 of file types.hpp.

Constructor & Destructor Documentation

◆ Enqueue()

ocilib::Enqueue::Enqueue ( const TypeInfo typeInfo,
const ostring queueName 
)
inline

Create a Enqueue object for the given queue.

Parameters
typeInfo- Type info handle
queueName- Queue name
Note
OCILIB supports 2 types of message payload :
  • Oracle types (UDT)
  • RAW data
Oracle Type AnyData is not supported in the current version of OCILIB
the parameter 'typeInfo' indicates the type of payload to enqueue to the given queue :
  • For object payload, retrieve the object type information object from the given type name
  • For RAW payload, you MUST pass the object type information object from the type name "SYS.RAW" as object type name

Definition at line 30 of file Enqueue.hpp.

References ocilib::core::Check(), ocilib::TypeInfo::GetConnection(), and OCI_EnqueueCreate().

Member Function Documentation

◆ Put()

void ocilib::Enqueue::Put ( const Message message)
inline

Enqueue a message the on queue associated to the Enqueue object.

Parameters
message- Message to enqueue

Definition at line 41 of file Enqueue.hpp.

References ocilib::core::Check(), and OCI_EnqueuePut().

◆ GetVisibility()

Enqueue::EnqueueVisibility ocilib::Enqueue::GetVisibility ( ) const
inline

Get the enqueuing/locking behavior.

Note
see SetVisibility() for more details

Definition at line 46 of file Enqueue.hpp.

References ocilib::core::Check(), and OCI_EnqueueGetVisibility().

◆ SetVisibility()

void ocilib::Enqueue::SetVisibility ( EnqueueVisibility  value)
inline

Set whether the new message is enqueued as part of the current transaction.

Parameters
value- Enqueuing visibility
Note
Default value is Enqueue::OnCommit

Definition at line 51 of file Enqueue.hpp.

References ocilib::core::Check(), and OCI_EnqueueSetVisibility().

◆ GetMode()

Enqueue::EnqueueMode ocilib::Enqueue::GetMode ( ) const
inline

Return the enqueuing mode of messages to enqueue.

Note
see SetMode() for more details

Definition at line 56 of file Enqueue.hpp.

References ocilib::core::Check(), and OCI_EnqueueGetSequenceDeviation().

◆ SetMode()

void ocilib::Enqueue::SetMode ( EnqueueMode  value)
inline

Set the enqueuing mode of messages to put in the queue.

Parameters
value- enqueuing mode
Note
Default value is Enqueue::OnTop
if the parameter 'value' is set to Enqueue::Before, the application must call SetRelativeMsgID() before enqueuing the next message in the queue.
In order to stop enqueuing message using a sequence deviation, call SetMode() with the value Enqueue::OnTop

Definition at line 61 of file Enqueue.hpp.

References ocilib::core::Check(), and OCI_EnqueueSetSequenceDeviation().

◆ GetRelativeMsgID()

Raw ocilib::Enqueue::GetRelativeMsgID ( ) const
inline

Get the current associated message identifier used for enqueuing messages using a sequence deviation.

Note
see SetRelativeMsgID() for more details

Definition at line 66 of file Enqueue.hpp.

References ocilib::core::Check(), ocilib::core::MakeRaw(), and OCI_EnqueueGetRelativeMsgID().

◆ SetRelativeMsgID()

void ocilib::Enqueue::SetRelativeMsgID ( const Raw value)
inline

Set a message identifier to use for enqueuing messages using a sequence deviation.

Parameters
value- message identifier
Note
This call is only valid if SetMode() has been called with the value Enqueue::Before
see SetMode() for more details

Definition at line 77 of file Enqueue.hpp.

References ocilib::core::Check(), and OCI_EnqueueSetRelativeMsgID().