import { PolicySource } from "./policySource" ; import { UiThread } from "./uiThread" ; export class UiRequest { public id : string ; public threads : UiThread [ ] ; private operationId : string ; private apiId : string ; private productId : string ; constructor ( id , operationId , apiId , productId ) { this . id = id ; this . threads = [ ] ; this . operationId = operationId ; this . apiId = apiId ; this . productId = productId ; } public addNewThread ( gatewayThread , policySource ) { let thread ; this . threads . push ( thread = new UiThread ( gatewayThread , this . operationId , this . apiId , this . productId , policySource ) ) ; return thread ; } public findThreadByStackFrameId ( id ) { for ( const thread of this . threads ) { if ( thread . containsStackFrame ( id ) ) { return thread ; } } return null ; } public findThreadById ( id ) { for ( const thread of this . threads ) { if ( thread . id === id ) { return thread ; } } return null ; } public findThreadByUiId ( uiId ) { for ( const thread of this . threads ) { if ( thread . uiId === uiId ) { return thread ; } } return null ; } }