private void addWebsocketForwardingListeners ( RepositoryCreationTask task ) { Consumer < ? extends BpmNotificationRest > doNotify = ( e ) - > wsNotifier . sendMessage ( e ) ; task . addListener ( BpmEventType . RC_REPO_CREATION_SUCCESS , doNotify ) ; task . addListener ( BpmEventType . RC_REPO_CREATION_ERROR , doNotify ) ; task . addListener ( BpmEventType . RC_REPO_CLONE_SUCCESS , doNotify ) ; task . addListener ( BpmEventType . RC_REPO_CLONE_ERROR , doNotify ) ; //clients are notified from callback in startRCreationTask //task.addListener(BpmEventType.RC_CREATION_SUCCESS, doNotify); task . addListener ( BpmEventType . RC_CREATION_ERROR , doNotify ) ; }
This method will add listeners to all important RCC event types and forward the event to WS clients .