@@ -61,59 +61,69 @@ export abstract class OdpEventManager implements IOdpEventManager {
6161 /**
6262 * Current state of the event processor
6363 */
64- public state : STATE = STATE . STOPPED ;
64+ state : STATE = STATE . STOPPED ;
65+
6566 /**
6667 * Queue for holding all events to be eventually dispatched
6768 * @protected
6869 */
6970 protected queue = new Array < OdpEvent > ( ) ;
71+
7072 /**
7173 * Identifier of the currently running timeout so clearCurrentTimeout() can be called
7274 * @private
7375 */
7476 private timeoutId ?: NodeJS . Timeout | number ;
77+
7578 /**
76- * ODP configuration settings in used
79+ * ODP configuration settings for identifying the target API and segments
7780 * @private
7881 */
7982 private odpConfig : OdpConfig ;
83+
8084 /**
8185 * REST API Manager used to send the events
8286 * @private
8387 */
8488 private readonly apiManager : IOdpEventApiManager ;
89+
8590 /**
8691 * Handler for recording execution logs
8792 * @private
8893 */
8994 private readonly logger : LogHandler ;
95+
9096 /**
9197 * Maximum queue size
9298 * @protected
9399 */
94100 protected queueSize ! : number ;
101+
95102 /**
96103 * Maximum number of events to process at once. Ignored in browser context
97104 * @protected
98105 */
99106 protected batchSize ! : number ;
107+
100108 /**
101109 * Milliseconds between setTimeout() to process new batches. Ignored in browser context
102110 * @protected
103111 */
104112 protected flushInterval ! : number ;
113+
105114 /**
106115 * Type of execution context eg node, js, react
107116 * @private
108117 */
109118 private readonly clientEngine : string ;
119+
110120 /**
111121 * Version of the client being used
112122 * @private
113123 */
114124 private readonly clientVersion : string ;
115125
116- public constructor ( {
126+ constructor ( {
117127 odpConfig,
118128 apiManager,
119129 logger,
@@ -151,21 +161,21 @@ export abstract class OdpEventManager implements IOdpEventManager {
151161 * Update ODP configuration settings.
152162 * @param newConfig New configuration to apply
153163 */
154- public updateSettings ( newConfig : OdpConfig ) : void {
164+ updateSettings ( newConfig : OdpConfig ) : void {
155165 this . odpConfig = newConfig ;
156166 }
157167
158168 /**
159169 * Cleans up all pending events; occurs every time the ODP Config is updated.
160170 */
161- public flush ( ) : void {
171+ flush ( ) : void {
162172 this . processQueue ( true ) ;
163173 }
164174
165175 /**
166176 * Start processing events in the queue
167177 */
168- public start ( ) : void {
178+ start ( ) : void {
169179 this . state = STATE . RUNNING ;
170180
171181 this . setNewTimeout ( ) ;
@@ -174,7 +184,7 @@ export abstract class OdpEventManager implements IOdpEventManager {
174184 /**
175185 * Drain the queue sending all remaining events in batches then stop processing
176186 */
177- public async stop ( ) : Promise < void > {
187+ async stop ( ) : Promise < void > {
178188 this . logger . log ( LogLevel . DEBUG , 'Stop requested.' ) ;
179189
180190 await this . processQueue ( true ) ;
@@ -187,7 +197,7 @@ export abstract class OdpEventManager implements IOdpEventManager {
187197 * Register a new visitor user id (VUID) in ODP
188198 * @param vuid Visitor User ID to send
189199 */
190- public registerVuid ( vuid : string ) : void {
200+ registerVuid ( vuid : string ) : void {
191201 const identifiers = new Map < string , string > ( ) ;
192202 identifiers . set ( ODP_USER_KEY . VUID , vuid ) ;
193203
@@ -200,7 +210,7 @@ export abstract class OdpEventManager implements IOdpEventManager {
200210 * @param {string } userId (Optional) Full-stack User ID
201211 * @param {string } vuid (Optional) Visitor User ID
202212 */
203- public identifyUser ( userId ?: string , vuid ?: string ) : void {
213+ identifyUser ( userId ?: string , vuid ?: string ) : void {
204214 const identifiers = new Map < string , string > ( ) ;
205215 if ( ! userId && ! vuid ) {
206216 this . logger . log ( LogLevel . ERROR , ERROR_MESSAGES . ODP_SEND_EVENT_FAILED_UID_MISSING ) ;
@@ -223,7 +233,7 @@ export abstract class OdpEventManager implements IOdpEventManager {
223233 * Send an event to ODP via dispatch queue
224234 * @param event ODP Event to forward
225235 */
226- public sendEvent ( event : OdpEvent ) : void {
236+ sendEvent ( event : OdpEvent ) : void {
227237 if ( invalidOdpDataFound ( event . data ) ) {
228238 this . logger . log ( LogLevel . ERROR , 'Event data found to be invalid.' ) ;
229239 } else {
0 commit comments