UNPKG

2.91 kBJavaScriptView Raw
1// Copyright (c) 2019, 2022, 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
27'use strict';
28
29const constants = require('./constants.js');
30const errors = require('./errors.js');
31
32class AqEnqOptions {
33
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);
77 }
78
79}
80
81module.exports = AqEnqOptions;