use of org.eclipse.sirius.components.collaborative.validation.dto.ValidationRefreshedEventPayload in project sirius-components by eclipse-sirius.
the class ValidationEventProcessor method refresh.
@Override
public void refresh(ChangeDescription changeDescription) {
if (this.shouldRefresh(changeDescription)) {
long start = System.currentTimeMillis();
Validation validation = this.refreshValidation();
this.validationContext.update(validation);
if (this.sink.currentSubscriberCount() > 0) {
EmitResult emitResult = this.sink.tryEmitNext(new ValidationRefreshedEventPayload(changeDescription.getInput().getId(), validation));
if (emitResult.isFailure()) {
// $NON-NLS-1$
String pattern = "An error has occurred while emitting a ValidationRefreshedEventPayload: {}";
this.logger.warn(pattern, emitResult);
}
}
long end = System.currentTimeMillis();
this.timer.record(end - start, TimeUnit.MILLISECONDS);
}
}
use of org.eclipse.sirius.components.collaborative.validation.dto.ValidationRefreshedEventPayload in project sirius-components by eclipse-sirius.
the class ValidationEventProcessor method getOutputEvents.
@Override
public Flux<IPayload> getOutputEvents(IInput input) {
var initialRefresh = Mono.fromCallable(() -> new ValidationRefreshedEventPayload(input.getId(), this.validationContext.getValidation()));
var refreshEventFlux = Flux.concat(initialRefresh, this.sink.asFlux());
// @formatter:off
return Flux.merge(refreshEventFlux, this.subscriptionManager.getFlux(input));
// @formatter:on
}
Aggregations