UNPKG

4.75 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 DbObjectImpl = require('./impl/dbObject.js');
30
31class AqMessage {
32
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();
136 }
137
138}
139
140module.exports = AqMessage;