OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
QueueTable.hpp
1 /*
2  * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
3  *
4  * Website: http://www.ocilib.net
5  *
6  * Copyright (c) 2007-2023 Vincent ROGIER <vince.rogier@ocilib.net>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #pragma once
22 
23 #include "ocilibcpp/types.hpp"
24 
25 namespace ocilib
26 {
27 
28 inline void QueueTable::Create(const Connection &connection, const ostring& table, const ostring& payloadType, bool multipleConsumers, const ostring& storageClause, const ostring& sortList,
29  GroupingMode groupingMode, const ostring& comment, unsigned int primaryInstance, unsigned int secondaryInstance, const ostring& compatible)
30 
31 {
32  core::Check(OCI_QueueTableCreate(connection, table.c_str(), payloadType.c_str(), storageClause.c_str(), sortList.c_str(), multipleConsumers,
33  groupingMode, comment.c_str(), primaryInstance, secondaryInstance, compatible.c_str()));
34 }
35 
36 inline void QueueTable::Alter(const Connection &connection, const ostring& table, const ostring& comment, unsigned int primaryInstance, unsigned int secondaryInstance)
37 {
38  core::Check(OCI_QueueTableAlter(connection, table.c_str(), comment.c_str(), primaryInstance, secondaryInstance));
39 }
40 
41 inline void QueueTable::Drop(const Connection &connection, const ostring& table, bool force)
42 {
43  core::Check(OCI_QueueTableDrop(connection, table.c_str(), force));
44 }
45 
46 inline void QueueTable::Purge(const Connection &connection, const ostring& table, PurgeMode mode, const ostring& condition, bool block)
47 {
48  core::Check(OCI_QueueTablePurge(connection, table.c_str(), condition.c_str(), block, static_cast<unsigned int>(mode)));
49 }
50 
51 inline void QueueTable::Migrate(const Connection &connection, const ostring& table, const ostring& compatible)
52 {
53  core::Check(OCI_QueueTableMigrate(connection, table.c_str(), compatible.c_str()));
54 }
55 
56 }
A connection or session with a specific database.
Definition: types.hpp:1580
static void Drop(const Connection &connection, const ostring &table, bool force=true)
Drop the given queue table.
Definition: QueueTable.hpp:41
static void Migrate(const Connection &connection, const ostring &table, const ostring &compatible=OTEXT(""))
Migrate a queue table from one version to another.
Definition: QueueTable.hpp:51
static void Create(const Connection &connection, const ostring &table, const ostring &payloadType, bool multipleConsumers, const ostring &storageClause=OTEXT(""), const ostring &sortList=OTEXT(""), GroupingMode groupingMode=None, const ostring &comment=OTEXT(""), unsigned int primaryInstance=0, unsigned int secondaryInstance=0, const ostring &compatible=OTEXT(""))
Create a queue table for messages of the given type.
Definition: QueueTable.hpp:28
static void Purge(const Connection &connection, const ostring &table, PurgeMode mode, const ostring &condition=OTEXT(""), bool block=true)
Purge messages from the given queue table.
Definition: QueueTable.hpp:46
static void Alter(const Connection &connection, const ostring &table, const ostring &comment, unsigned int primaryInstance=0, unsigned int secondaryInstance=0)
Alter the given queue table.
Definition: QueueTable.hpp:36
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:118
OCI_SYM_PUBLIC boolean OCI_API OCI_QueueTableDrop(OCI_Connection *con, const otext *queue_table, boolean force)
Drop the given queue table.
OCI_SYM_PUBLIC boolean OCI_API OCI_QueueTablePurge(OCI_Connection *con, const otext *queue_table, const otext *purge_condition, boolean block, unsigned int delivery_mode)
Purge messages from the given queue table.
OCI_SYM_PUBLIC boolean OCI_API OCI_QueueTableAlter(OCI_Connection *con, const otext *queue_table, const otext *comment, unsigned int primary_instance, unsigned int secondary_instance)
Alter the given queue table.
OCI_SYM_PUBLIC boolean OCI_API OCI_QueueTableMigrate(OCI_Connection *con, const otext *queue_table, const otext *compatible)
Migrate a queue table from one version to another.
OCI_SYM_PUBLIC boolean OCI_API OCI_QueueTableCreate(OCI_Connection *con, const otext *queue_table, const otext *queue_payload_type, const otext *storage_clause, const otext *sort_list, boolean multiple_consumers, unsigned int message_grouping, const otext *comment, unsigned int primary_instance, unsigned int secondary_instance, const otext *compatible)
Create a queue table for messages of the given type.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
Definition: Utils.hpp:53
OCILIB ++ Namespace.
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 )
Definition: config.hpp:120