public void withConsumer(Consumer<P> consumer) { withBiConsumer((endpointId, pValue) -> consumer.accept(pValue)); } }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:ws-agent-output:un-subscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceId) -> { endpointIds.getOrDefault(endpointId, emptySet()).remove(workspaceId); endpointIds.entrySet().removeIf(entry -> entry.getValue().isEmpty()); }); }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:environment-output:un-subscribe-by-machine-name") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdPlusMachineName) -> { endpointIds.getOrDefault(endpointId, emptySet()).remove(workspaceIdPlusMachineName); endpointIds.entrySet().removeIf(entry -> entry.getValue().isEmpty()); }); }
@Inject private void configureSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:ws-agent-output:subscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceId) -> { endpointIds.putIfAbsent(endpointId, newConcurrentHashSet()); endpointIds.get(endpointId).add(workspaceId); }); }
@Inject private void configureSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:environment-output:subscribe-by-machine-name") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdPlusMachineName) -> { endpointIds.putIfAbsent(endpointId, newConcurrentHashSet()); endpointIds.get(endpointId).add(workspaceIdPlusMachineName); }); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("connected") .paramsAsDto(ConnectedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_started") .paramsAsDto(ProcessStartedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_died") .paramsAsDto(ProcessDiedEventDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("event:file-state-changed") .paramsAsDto(FileStateUpdateDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_stderr") .paramsAsDto(ProcessStdErrEventDto.class) .noResult() .withBiConsumer(this); }
@Inject public void configureHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("process_stdout") .paramsAsDto(ProcessStdOutEventDto.class) .noResult() .withBiConsumer(this); }
@Inject private void configureUnSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("git/checkoutOutput/unsubscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdAndProjectName) -> { endpointIdsWithWorkspaceIdAndProjectName .getOrDefault(endpointId, newConcurrentHashSet()) .remove(workspaceIdAndProjectName); endpointIdsWithWorkspaceIdAndProjectName.computeIfPresent( endpointId, (key, value) -> value.isEmpty() ? null : value); }); } }
@Inject protected void handleEvents() { configurator .newConfiguration() .methodName(EVENT_JDT_PROJECT_UPDATED) .paramsAsDto(String.class) .noResult() .withBiConsumer( (endpointId, projectPath) -> { onProjectUpdated(projectPath); }); }
@Inject WorkspaceStatusEventHandler( RequestHandlerConfigurator configurator, WorkspaceServiceClient workspaceServiceClient, AppContext appContext, EventBus eventBus) { this.workspaceServiceClient = workspaceServiceClient; this.appContext = appContext; this.eventBus = eventBus; configurator .newConfiguration() .methodName(WORKSPACE_STATUS_CHANGED_METHOD) .paramsAsDto(WorkspaceStatusEvent.class) .noResult() .withBiConsumer((endpointId, event) -> processStatus(event)); }
@Inject private void configureSubscription(RequestHandlerConfigurator requestHandlerConfigurator) { requestHandlerConfigurator .newConfiguration() .methodName(SUBSCRIBE_JSON_RPC_METHOD) .paramsAsDto(EventSubscription.class) .noResult() .withBiConsumer(this::consumeSubscriptionRequest); requestHandlerConfigurator .newConfiguration() .methodName(UNSUBSCRIBE_JSON_RPC_METHOD) .paramsAsDto(EventSubscription.class) .noResult() .withBiConsumer(this::consumeUnSubscriptionRequest); }
@Inject ServerStatusEventHandler( RequestHandlerConfigurator configurator, WorkspaceServiceClient workspaceServiceClient, AppContext appContext, EventBus eventBus, WsAgentServerUtil wsAgentServerUtil) { this.workspaceServiceClient = workspaceServiceClient; this.appContext = appContext; this.eventBus = eventBus; this.wsAgentServerUtil = wsAgentServerUtil; configurator .newConfiguration() .methodName(SERVER_STATUS_CHANGED_METHOD) .paramsAsDto(ServerStatusEvent.class) .noResult() .withBiConsumer( (endpointId, event) -> { Log.debug(getClass(), "Received notification from endpoint: " + endpointId); processStatus(event); }); }
@Inject private void configureSubscribeHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName("git/checkoutOutput/subscribe") .paramsAsString() .noResult() .withBiConsumer( (endpointId, workspaceIdAndProjectName) -> { endpointIdsWithWorkspaceIdAndProjectName.putIfAbsent( endpointId, newConcurrentHashSet()); endpointIdsWithWorkspaceIdAndProjectName .get(endpointId) .add(workspaceIdAndProjectName); }); configurator .newConfiguration() .methodName("event/git/subscribe") .noParams() .noResult() .withConsumer(endpointIds::add); }
@Inject RuntimeLogHandler(RequestHandlerConfigurator configurator, EventBus eventBus) { configurator .newConfiguration() .methodName(RUNTIME_LOG_METHOD) .paramsAsDto(RuntimeLogEvent.class) .noResult() .withBiConsumer( (endpointId, log) -> eventBus.fireEvent( new EnvironmentOutputEvent(log.getText(), log.getMachineName()))); } }
@Inject InstallerLogHandler(RequestHandlerConfigurator configurator, EventBus eventBus) { configurator .newConfiguration() .methodName(INSTALLER_LOG_METHOD) .paramsAsDto(InstallerLogEvent.class) .noResult() .withBiConsumer( (endpointId, log) -> eventBus.fireEvent( new EnvironmentOutputEvent(log.getText(), log.getMachineName()))); } }
.paramsAsDto(InstallerStatusEvent.class) .noResult() .withBiConsumer( (endpointId, event) -> { switch (event.getStatus()) {