oracledb 5.4.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1849
- package/LICENSE.txt +8 -222
- package/NOTICE.txt +1 -1
- package/README.md +38 -30
- package/SECURITY.md +38 -0
- package/THIRD_PARTY_LICENSES.txt +1 -1
- package/build/Release/oracledb-6.0.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.0.0-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.0.0-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.0.0-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.0.0-win32-x64.node-buildinfo.txt +1 -0
- package/examples/README.md +113 -0
- package/examples/dbconfig.js +100 -0
- package/examples/example.js +156 -0
- package/index.js +26 -0
- package/lib/aqDeqOptions.js +146 -7
- package/lib/aqEnqOptions.js +59 -7
- package/lib/aqMessage.js +118 -7
- package/lib/aqQueue.js +242 -53
- package/lib/connection.js +1324 -465
- package/lib/constants.js +203 -0
- package/lib/dbObject.js +346 -32
- package/lib/errors.js +781 -0
- package/lib/impl/aqDeqOptions.js +197 -0
- package/lib/impl/aqEnqOptions.js +89 -0
- package/lib/impl/aqMessage.js +134 -0
- package/lib/impl/aqQueue.js +81 -0
- package/lib/impl/connection.js +529 -0
- package/lib/impl/dbObject.js +159 -0
- package/lib/impl/index.js +59 -0
- package/lib/impl/lob.js +85 -0
- package/lib/impl/pool.js +195 -0
- package/lib/impl/resultset.js +223 -0
- package/lib/impl/sodaCollection.js +174 -0
- package/lib/impl/sodaDatabase.js +81 -0
- package/lib/impl/sodaDocCursor.js +63 -0
- package/lib/impl/sodaDocument.js +98 -0
- package/lib/impl/sodaOperation.js +109 -0
- package/lib/lob.js +156 -68
- package/lib/oracledb.js +1051 -257
- package/lib/pool.js +654 -465
- package/lib/poolStatistics.js +23 -9
- package/lib/queryStream.js +14 -7
- package/lib/resultset.js +292 -171
- package/lib/settings.js +191 -0
- package/lib/sodaCollection.js +214 -201
- package/lib/sodaDatabase.js +107 -71
- package/lib/sodaDocCursor.js +44 -32
- package/lib/sodaDocument.js +76 -14
- package/lib/sodaOperation.js +131 -118
- package/lib/thin/connection.js +1038 -0
- package/lib/thin/dbObject.js +629 -0
- package/lib/thin/index.js +40 -0
- package/lib/thin/lob.js +188 -0
- package/lib/thin/pool.js +481 -0
- package/lib/thin/protocol/buffer.js +1040 -0
- package/lib/thin/protocol/capabilities.js +116 -0
- package/lib/thin/protocol/constants.js +764 -0
- package/lib/thin/protocol/encryptDecrypt.js +185 -0
- package/lib/thin/protocol/messages/auth.js +348 -0
- package/lib/thin/protocol/messages/base.js +475 -0
- package/lib/thin/protocol/messages/commit.js +56 -0
- package/lib/thin/protocol/messages/dataType.js +382 -0
- package/lib/thin/protocol/messages/execute.js +312 -0
- package/lib/thin/protocol/messages/fetch.js +60 -0
- package/lib/thin/protocol/messages/index.js +53 -0
- package/lib/thin/protocol/messages/lobOp.js +200 -0
- package/lib/thin/protocol/messages/logOff.js +53 -0
- package/lib/thin/protocol/messages/ping.js +56 -0
- package/lib/thin/protocol/messages/protocol.js +78 -0
- package/lib/thin/protocol/messages/rollback.js +56 -0
- package/lib/thin/protocol/messages/sessionRelease.js +60 -0
- package/lib/thin/protocol/messages/withData.js +811 -0
- package/lib/thin/protocol/oson.js +660 -0
- package/lib/thin/protocol/packet.js +520 -0
- package/lib/thin/protocol/protocol.js +202 -0
- package/lib/thin/protocol/utils.js +88 -0
- package/lib/thin/resultSet.js +122 -0
- package/lib/thin/sqlnet/connStrategy.js +175 -0
- package/lib/thin/sqlnet/constants.js +199 -0
- package/lib/thin/sqlnet/ezConnectResolver.js +488 -0
- package/lib/thin/sqlnet/navNodes.js +870 -0
- package/lib/thin/sqlnet/networkSession.js +620 -0
- package/lib/thin/sqlnet/ntTcp.js +525 -0
- package/lib/thin/sqlnet/nvStrToNvPair.js +783 -0
- package/lib/thin/sqlnet/packet.js +405 -0
- package/lib/thin/sqlnet/paramParser.js +205 -0
- package/lib/thin/sqlnet/sessionAtts.js +160 -0
- package/lib/thin/statement.js +301 -0
- package/lib/thin/util.js +289 -0
- package/lib/transformer.js +250 -0
- package/lib/types.js +357 -0
- package/lib/util.js +194 -108
- package/lib/version.js +36 -0
- package/package/README.md +33 -30
- package/package/install.js +89 -64
- package/package/prunebinaries.js +60 -12
- package/package.json +3 -3
- package/build/Release/oracledb-5.4.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-5.4.0-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-5.4.0-linux-x64.node +0 -0
- package/build/Release/oracledb-5.4.0-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-5.4.0-win32-x64.node +0 -0
- package/build/Release/oracledb-5.4.0-win32-x64.node-buildinfo.txt +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/* Copyright (c) 2018, 2023, Oracle and/or its affiliates. */
|
|
2
|
+
|
|
3
|
+
/******************************************************************************
|
|
4
|
+
*
|
|
5
|
+
* This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
* (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
* 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
* either license.
|
|
9
|
+
*
|
|
10
|
+
* If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
* the following applies:
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*
|
|
25
|
+
* NAME
|
|
26
|
+
* example.js
|
|
27
|
+
*
|
|
28
|
+
* DESCRIPTION
|
|
29
|
+
* A basic node-oracledb example.
|
|
30
|
+
*
|
|
31
|
+
* For connection pool examples see connectionpool.js and webapp.js
|
|
32
|
+
* For a ResultSet example see resultset1.js
|
|
33
|
+
* For a query stream example see selectstream.js
|
|
34
|
+
*
|
|
35
|
+
*****************************************************************************/
|
|
36
|
+
|
|
37
|
+
'use strict';
|
|
38
|
+
|
|
39
|
+
Error.stackTraceLimit = 50;
|
|
40
|
+
|
|
41
|
+
const oracledb = require('oracledb');
|
|
42
|
+
const dbConfig = require('./dbconfig.js');
|
|
43
|
+
|
|
44
|
+
// This example runs in both node-oracledb Thin and Thick modes.
|
|
45
|
+
//
|
|
46
|
+
// Optionally run in node-oracledb Thick mode
|
|
47
|
+
if (process.env.NODE_ORACLEDB_DRIVER_MODE === 'thick') {
|
|
48
|
+
|
|
49
|
+
// Thick mode requires Oracle Client or Oracle Instant Client libraries.
|
|
50
|
+
// On Windows and macOS Intel you can specify the directory containing the
|
|
51
|
+
// libraries at runtime or before Node.js starts. On other platforms (where
|
|
52
|
+
// Oracle libraries are available) the system library search path must always
|
|
53
|
+
// include the Oracle library path before Node.js starts. If the search path
|
|
54
|
+
// is not correct, you will get a DPI-1047 error. See the node-oracledb
|
|
55
|
+
// installation documentation.
|
|
56
|
+
let clientOpts = {};
|
|
57
|
+
if (process.platform === 'win32') { // Windows
|
|
58
|
+
clientOpts = { libDir: 'C:\\oracle\\instantclient_19_17' };
|
|
59
|
+
} else if (process.platform === 'darwin' && process.arch === 'x64') { // macOS Intel
|
|
60
|
+
clientOpts = { libDir: process.env.HOME + '/Downloads/instantclient_19_8' };
|
|
61
|
+
}
|
|
62
|
+
oracledb.initOracleClient(clientOpts); // enable node-oracledb Thick mode
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function run() {
|
|
66
|
+
let connection;
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
|
|
70
|
+
let sql, binds, options, result;
|
|
71
|
+
|
|
72
|
+
connection = await oracledb.getConnection(dbConfig);
|
|
73
|
+
|
|
74
|
+
//
|
|
75
|
+
// Create a table
|
|
76
|
+
//
|
|
77
|
+
|
|
78
|
+
const stmts = [
|
|
79
|
+
`DROP TABLE no_example`,
|
|
80
|
+
|
|
81
|
+
`CREATE TABLE no_example (id NUMBER, data VARCHAR2(20))`
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
for (const s of stmts) {
|
|
85
|
+
try {
|
|
86
|
+
await connection.execute(s);
|
|
87
|
+
} catch (e) {
|
|
88
|
+
if (e.errorNum != 942)
|
|
89
|
+
console.error(e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//
|
|
94
|
+
// Insert three rows
|
|
95
|
+
//
|
|
96
|
+
|
|
97
|
+
sql = `INSERT INTO no_example VALUES (:1, :2)`;
|
|
98
|
+
|
|
99
|
+
binds = [
|
|
100
|
+
[101, "Alpha" ],
|
|
101
|
+
[102, "Beta" ],
|
|
102
|
+
[103, "Gamma" ]
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
// For a complete list of options see the documentation.
|
|
106
|
+
options = {
|
|
107
|
+
autoCommit: true,
|
|
108
|
+
// batchErrors: true, // continue processing even if there are data errors
|
|
109
|
+
bindDefs: [
|
|
110
|
+
{ type: oracledb.NUMBER },
|
|
111
|
+
{ type: oracledb.STRING, maxSize: 20 }
|
|
112
|
+
]
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
result = await connection.executeMany(sql, binds, options);
|
|
116
|
+
|
|
117
|
+
console.log("Number of rows inserted:", result.rowsAffected);
|
|
118
|
+
|
|
119
|
+
//
|
|
120
|
+
// Query the data
|
|
121
|
+
//
|
|
122
|
+
|
|
123
|
+
sql = `SELECT * FROM no_example`;
|
|
124
|
+
|
|
125
|
+
binds = {};
|
|
126
|
+
|
|
127
|
+
// For a complete list of options see the documentation.
|
|
128
|
+
options = {
|
|
129
|
+
outFormat: oracledb.OUT_FORMAT_OBJECT, // query result format
|
|
130
|
+
// extendedMetaData: true, // get extra metadata
|
|
131
|
+
// fetchArraySize: 100 // internal buffer allocation size for tuning
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
result = await connection.execute(sql, binds, options);
|
|
135
|
+
|
|
136
|
+
// Column metadata can be shown, if desired
|
|
137
|
+
// console.log("Metadata: ");
|
|
138
|
+
// console.dir(result.metaData, { depth: null });
|
|
139
|
+
|
|
140
|
+
console.log("Query results: ");
|
|
141
|
+
console.dir(result.rows, { depth: null });
|
|
142
|
+
|
|
143
|
+
} catch (err) {
|
|
144
|
+
console.error(err);
|
|
145
|
+
} finally {
|
|
146
|
+
if (connection) {
|
|
147
|
+
try {
|
|
148
|
+
await connection.close();
|
|
149
|
+
} catch (err) {
|
|
150
|
+
console.error(err);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
run();
|
package/index.js
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
+
// Copyright (c) 2015, 2023, Oracle and/or its affiliates.
|
|
2
|
+
|
|
3
|
+
//-----------------------------------------------------------------------------
|
|
4
|
+
//
|
|
5
|
+
// This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
// either license.
|
|
9
|
+
//
|
|
10
|
+
// If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
// the following applies:
|
|
12
|
+
//
|
|
13
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
// you may not use this file except in compliance with the License.
|
|
15
|
+
// You may obtain a copy of the License at
|
|
16
|
+
//
|
|
17
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
//
|
|
19
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
// See the License for the specific language governing permissions and
|
|
23
|
+
// limitations under the License.
|
|
24
|
+
//
|
|
25
|
+
//-----------------------------------------------------------------------------
|
|
26
|
+
|
|
1
27
|
module.exports = require('./lib/oracledb.js');
|
package/lib/aqDeqOptions.js
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
5
|
+
// This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
// either license.
|
|
7
9
|
//
|
|
10
|
+
// If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
// the following applies:
|
|
12
|
+
//
|
|
13
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
// you may not use this file except in compliance with the License.
|
|
8
15
|
// You may obtain a copy of the License at
|
|
9
|
-
// http://www.apache.org/licenses/LICENSE-2.0.
|
|
10
16
|
//
|
|
11
|
-
//
|
|
12
|
-
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
-
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
14
18
|
//
|
|
19
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
22
|
// See the License for the specific language governing permissions and
|
|
16
23
|
// limitations under the License.
|
|
17
24
|
//
|
|
@@ -19,9 +26,141 @@
|
|
|
19
26
|
|
|
20
27
|
'use strict';
|
|
21
28
|
|
|
29
|
+
const constants = require('./constants.js');
|
|
30
|
+
const errors = require('./errors.js');
|
|
31
|
+
|
|
22
32
|
class AqDeqOptions {
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
//---------------------------------------------------------------------------
|
|
35
|
+
// condition
|
|
36
|
+
//
|
|
37
|
+
// Property for the condition to use for dequeuing messages.
|
|
38
|
+
//---------------------------------------------------------------------------
|
|
39
|
+
get condition() {
|
|
40
|
+
return this._impl.getCondition();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set condition(value) {
|
|
44
|
+
errors.assertPropValue(typeof value === 'string', "condition");
|
|
45
|
+
this._impl.setCondition(value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//---------------------------------------------------------------------------
|
|
49
|
+
// consumerName
|
|
50
|
+
//
|
|
51
|
+
// Property for the consumer name to use for dequeuing messages.
|
|
52
|
+
//---------------------------------------------------------------------------
|
|
53
|
+
get consumerName() {
|
|
54
|
+
return this._impl.getConsumerName();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
set consumerName(value) {
|
|
58
|
+
errors.assertPropValue(typeof value === 'string', "consumerName");
|
|
59
|
+
this._impl.setConsumerName(value);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//---------------------------------------------------------------------------
|
|
63
|
+
// correlation
|
|
64
|
+
//
|
|
65
|
+
// Property for the correlation to use for dequeuing messages.
|
|
66
|
+
//---------------------------------------------------------------------------
|
|
67
|
+
get correlation() {
|
|
68
|
+
return this._impl.getCorrelation();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
set correlation(value) {
|
|
72
|
+
errors.assertPropValue(typeof value === 'string', "correlation");
|
|
73
|
+
this._impl.setCorrelation(value);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//---------------------------------------------------------------------------
|
|
77
|
+
// mode
|
|
78
|
+
//
|
|
79
|
+
// Property for the mode to use for dequeuing messages.
|
|
80
|
+
//---------------------------------------------------------------------------
|
|
81
|
+
get mode() {
|
|
82
|
+
return this._impl.getMode();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
set mode(value) {
|
|
86
|
+
errors.assertPropValue(value === constants.AQ_DEQ_MODE_BROWSE ||
|
|
87
|
+
value === constants.AQ_DEQ_MODE_LOCKED ||
|
|
88
|
+
value === constants.AQ_DEQ_MODE_REMOVE ||
|
|
89
|
+
value === constants.AQ_DEQ_MODE_REMOVE_NO_DATA, "mode");
|
|
90
|
+
this._impl.setMode(value);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//---------------------------------------------------------------------------
|
|
94
|
+
// msgId
|
|
95
|
+
//
|
|
96
|
+
// Property for the message id to use for dequeuing messages.
|
|
97
|
+
//---------------------------------------------------------------------------
|
|
98
|
+
get msgId() {
|
|
99
|
+
return this._impl.getMsgId();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
set msgId(value) {
|
|
103
|
+
errors.assertPropValue(Buffer.isBuffer(value), "msgId");
|
|
104
|
+
this._impl.setMsgId(value);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//---------------------------------------------------------------------------
|
|
108
|
+
// navigation
|
|
109
|
+
//
|
|
110
|
+
// Property for the navigation to use for dequeuing messages.
|
|
111
|
+
//---------------------------------------------------------------------------
|
|
112
|
+
get navigation() {
|
|
113
|
+
return this._impl.getNavigation();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
set navigation(value) {
|
|
117
|
+
errors.assertPropValue(value === constants.AQ_DEQ_NAV_FIRST_MSG ||
|
|
118
|
+
value === constants.AQ_DEQ_NAV_NEXT_TRANSACTION ||
|
|
119
|
+
value === constants.AQ_DEQ_NAV_NEXT_MSG, "navigation");
|
|
120
|
+
this._impl.setNavigation(value);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//---------------------------------------------------------------------------
|
|
124
|
+
// transformation
|
|
125
|
+
//
|
|
126
|
+
// Property for the transformation to use for dequeuing messages.
|
|
127
|
+
//---------------------------------------------------------------------------
|
|
128
|
+
get transformation() {
|
|
129
|
+
return this._impl.getTransformation();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
set transformation(value) {
|
|
133
|
+
errors.assertPropValue(typeof value === 'string', "transformation");
|
|
134
|
+
this._impl.setTransformation(value);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//---------------------------------------------------------------------------
|
|
138
|
+
// visibility
|
|
139
|
+
//
|
|
140
|
+
// Property for the visibility to use for dequeuing messages.
|
|
141
|
+
//---------------------------------------------------------------------------
|
|
142
|
+
get visibility() {
|
|
143
|
+
return this._impl.getVisibility();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
set visibility(value) {
|
|
147
|
+
errors.assertPropValue(value === constants.AQ_VISIBILITY_IMMEDIATE ||
|
|
148
|
+
value === constants.AQ_VISIBILITY_ON_COMMIT, "visibility");
|
|
149
|
+
this._impl.setVisibility(value);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
//---------------------------------------------------------------------------
|
|
153
|
+
// wait
|
|
154
|
+
//
|
|
155
|
+
// Property for the time to wait for dequeuing messages.
|
|
156
|
+
//---------------------------------------------------------------------------
|
|
157
|
+
get wait() {
|
|
158
|
+
return this._impl.getWait();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
set wait(value) {
|
|
162
|
+
errors.assertPropValue(Number.isInteger(value) && value >= 0, "wait");
|
|
163
|
+
this._impl.setWait(value);
|
|
25
164
|
}
|
|
26
165
|
|
|
27
166
|
}
|
package/lib/aqEnqOptions.js
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
5
|
+
// This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
// either license.
|
|
7
9
|
//
|
|
10
|
+
// If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
// the following applies:
|
|
12
|
+
//
|
|
13
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
// you may not use this file except in compliance with the License.
|
|
8
15
|
// You may obtain a copy of the License at
|
|
9
|
-
// http://www.apache.org/licenses/LICENSE-2.0.
|
|
10
16
|
//
|
|
11
|
-
//
|
|
12
|
-
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
-
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
14
18
|
//
|
|
19
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
22
|
// See the License for the specific language governing permissions and
|
|
16
23
|
// limitations under the License.
|
|
17
24
|
//
|
|
@@ -19,9 +26,54 @@
|
|
|
19
26
|
|
|
20
27
|
'use strict';
|
|
21
28
|
|
|
29
|
+
const constants = require('./constants.js');
|
|
30
|
+
const errors = require('./errors.js');
|
|
31
|
+
|
|
22
32
|
class AqEnqOptions {
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
//---------------------------------------------------------------------------
|
|
35
|
+
// deliveryMode
|
|
36
|
+
//
|
|
37
|
+
// Property for the delivery mode to use for enqueuing messages.
|
|
38
|
+
//---------------------------------------------------------------------------
|
|
39
|
+
get deliveryMode() {
|
|
40
|
+
return this._impl.getDeliveryMode();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set deliveryMode(value) {
|
|
44
|
+
errors.assertPropValue(value === constants.AQ_MSG_DELIV_MODE_PERSISTENT ||
|
|
45
|
+
value === constants.AQ_MSG_DELIV_MODE_BUFFERED ||
|
|
46
|
+
value === constants.AQ_MSG_DELIV_MODE_PERSISTENT_OR_BUFFERED, "deliveryMode");
|
|
47
|
+
this._impl.setDeliveryMode(value);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//---------------------------------------------------------------------------
|
|
51
|
+
// transformation
|
|
52
|
+
//
|
|
53
|
+
// Property for the transformation to use for enqueuing messages.
|
|
54
|
+
//---------------------------------------------------------------------------
|
|
55
|
+
get transformation() {
|
|
56
|
+
return this._impl.getTransformation();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
set transformation(value) {
|
|
60
|
+
errors.assertPropValue(typeof value === 'string', "transformation");
|
|
61
|
+
this._impl.setTransformation(value);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//---------------------------------------------------------------------------
|
|
65
|
+
// visibility
|
|
66
|
+
//
|
|
67
|
+
// Property for the visibility to use for enqueuing messages.
|
|
68
|
+
//---------------------------------------------------------------------------
|
|
69
|
+
get visibility() {
|
|
70
|
+
return this._impl.getVisibility();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
set visibility(value) {
|
|
74
|
+
errors.assertPropValue(value === constants.AQ_VISIBILITY_IMMEDIATE ||
|
|
75
|
+
value === constants.AQ_VISIBILITY_ON_COMMIT, "visibility");
|
|
76
|
+
this._impl.setVisibility(value);
|
|
25
77
|
}
|
|
26
78
|
|
|
27
79
|
}
|
package/lib/aqMessage.js
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
5
|
+
// This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
// either license.
|
|
7
9
|
//
|
|
10
|
+
// If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
// the following applies:
|
|
12
|
+
//
|
|
13
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
// you may not use this file except in compliance with the License.
|
|
8
15
|
// You may obtain a copy of the License at
|
|
9
|
-
// http://www.apache.org/licenses/LICENSE-2.0.
|
|
10
16
|
//
|
|
11
|
-
//
|
|
12
|
-
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
-
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
14
18
|
//
|
|
19
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
22
|
// See the License for the specific language governing permissions and
|
|
16
23
|
// limitations under the License.
|
|
17
24
|
//
|
|
@@ -19,9 +26,113 @@
|
|
|
19
26
|
|
|
20
27
|
'use strict';
|
|
21
28
|
|
|
29
|
+
const DbObjectImpl = require('./impl/dbObject.js');
|
|
30
|
+
|
|
22
31
|
class AqMessage {
|
|
23
32
|
|
|
24
|
-
|
|
33
|
+
//---------------------------------------------------------------------------
|
|
34
|
+
// correlation
|
|
35
|
+
//
|
|
36
|
+
// Property for the correlation used for the message.
|
|
37
|
+
//---------------------------------------------------------------------------
|
|
38
|
+
get correlation() {
|
|
39
|
+
return this._impl.getCorrelation();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//---------------------------------------------------------------------------
|
|
43
|
+
// delay
|
|
44
|
+
//
|
|
45
|
+
// Property for the delay used for the message.
|
|
46
|
+
//---------------------------------------------------------------------------
|
|
47
|
+
get delay() {
|
|
48
|
+
return this._impl.getDelay();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//---------------------------------------------------------------------------
|
|
52
|
+
// deliveryMode
|
|
53
|
+
//
|
|
54
|
+
// Property for the delivery mode used for the message.
|
|
55
|
+
//---------------------------------------------------------------------------
|
|
56
|
+
get deliveryMode() {
|
|
57
|
+
return this._impl.getDeliveryMode();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//---------------------------------------------------------------------------
|
|
61
|
+
// exceptionQueue
|
|
62
|
+
//
|
|
63
|
+
// Property for the exception queue used for the message.
|
|
64
|
+
//---------------------------------------------------------------------------
|
|
65
|
+
get exceptionQueue() {
|
|
66
|
+
return this._impl.getExceptionQueue();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//---------------------------------------------------------------------------
|
|
70
|
+
// expiration
|
|
71
|
+
//
|
|
72
|
+
// Property for the expiration used for the message.
|
|
73
|
+
//---------------------------------------------------------------------------
|
|
74
|
+
get expiration() {
|
|
75
|
+
return this._impl.getExpiration();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//---------------------------------------------------------------------------
|
|
79
|
+
// msgId
|
|
80
|
+
//
|
|
81
|
+
// Property for the message id used for the message.
|
|
82
|
+
//---------------------------------------------------------------------------
|
|
83
|
+
get msgId() {
|
|
84
|
+
return this._impl.getMsgId();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//---------------------------------------------------------------------------
|
|
88
|
+
// numAttempts
|
|
89
|
+
//
|
|
90
|
+
// Property for the number of attempts used for the message.
|
|
91
|
+
//---------------------------------------------------------------------------
|
|
92
|
+
get numAttempts() {
|
|
93
|
+
return this._impl.getNumAttempts();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//---------------------------------------------------------------------------
|
|
97
|
+
// originalMsgId
|
|
98
|
+
//
|
|
99
|
+
// Property for the original message id used for the message.
|
|
100
|
+
//---------------------------------------------------------------------------
|
|
101
|
+
get originalMsgId() {
|
|
102
|
+
return this._impl.getOriginalMsgId();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//---------------------------------------------------------------------------
|
|
106
|
+
// payload
|
|
107
|
+
//
|
|
108
|
+
// Property for the payload used for the message.
|
|
109
|
+
//---------------------------------------------------------------------------
|
|
110
|
+
get payload() {
|
|
111
|
+
const payload = this._impl.getPayload();
|
|
112
|
+
if (payload instanceof DbObjectImpl) {
|
|
113
|
+
const obj = Object.create(this._payloadTypeClass.prototype);
|
|
114
|
+
obj._impl = payload;
|
|
115
|
+
return obj;
|
|
116
|
+
}
|
|
117
|
+
return payload;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//---------------------------------------------------------------------------
|
|
121
|
+
// priority
|
|
122
|
+
//
|
|
123
|
+
// Property for the priority used for the message.
|
|
124
|
+
//---------------------------------------------------------------------------
|
|
125
|
+
get priority() {
|
|
126
|
+
return this._impl.getPriority();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//---------------------------------------------------------------------------
|
|
130
|
+
// state
|
|
131
|
+
//
|
|
132
|
+
// Property for the state used for the message.
|
|
133
|
+
//---------------------------------------------------------------------------
|
|
134
|
+
get state() {
|
|
135
|
+
return this._impl.getState();
|
|
25
136
|
}
|
|
26
137
|
|
|
27
138
|
}
|