use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class AssigneeLiveSearchService method searchEntry.
@Override
public void searchEntry(String key, LiveSearchCallback<String> callback) {
SearchRequestImpl request = new SearchRequestImpl(key, 1, 1);
ErrorCallback<Message> searchErrorCallback = (message, throwable) -> processError(callback);
RemoteCallback<AbstractEntityManager.SearchResponse<?>> searchResponseRemoteCallback = response -> searchEntry(key, response, callback);
if (AssigneeType.USER.equals(type)) {
userSystemManager.users(searchResponseRemoteCallback, searchErrorCallback).search(request);
} else {
userSystemManager.groups(searchResponseRemoteCallback, searchErrorCallback).search(request);
}
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ProjectImportsScreenPresenterTest method verifyShowHide.
private void verifyShowHide(boolean positive) {
when(serviceCaller.call(any(RemoteCallback.class), any(ErrorCallback.class))).thenAnswer(new LoadContentAnswer(importsService, importsContent, positive ? null : errorCallback));
presenter.init(path, placeRequest);
verify(view).showLoading();
if (positive) {
verify(view).hideBusyIndicator();
} else {
verify(errorCallback).error(any(Message.class), any(Throwable.class));
}
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerRulesConfigPresenter method stopScanner.
public void stopScanner() {
view.disableActions();
ruleCapabilitiesService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
scannerStatus = KieScannerStatus.STOPPED;
setScannerStatus();
updateViewState();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getStopScannerErrorMessage(), NotificationEvent.NotificationType.ERROR));
updateViewState();
return false;
}
}).stopScanner(containerSpec);
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerRulesConfigPresenter method scanNow.
public void scanNow() {
view.disableActions();
ruleCapabilitiesService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
scannerStatus = KieScannerStatus.STOPPED;
setScannerStatus();
updateViewState();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getScanNowErrorMessage(), NotificationEvent.NotificationType.ERROR));
updateViewState();
return false;
}
}).scanNow(containerSpec);
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class ContainerRulesConfigPresenter method startScanner.
public void startScanner(final String interval, final String timeUnit) {
if (interval.trim().isEmpty()) {
view.errorOnInterval();
return;
}
Long actualInterval = calculateInterval(Long.valueOf(checkNotEmpty("interval", interval)), timeUnit);
view.disableActions();
ruleCapabilitiesService.call(new RemoteCallback<Void>() {
@Override
public void callback(final Void response) {
scannerStatus = KieScannerStatus.STARTED;
setScannerStatus();
updateViewState();
}
}, new ErrorCallback<Object>() {
@Override
public boolean error(final Object o, final Throwable throwable) {
notification.fire(new NotificationEvent(view.getStartScannerErrorMessage(), NotificationEvent.NotificationType.ERROR));
updateViewState();
return false;
}
}).startScanner(containerSpec, actualInterval);
}
Aggregations