Search in sources :

Example 1 with ErrorCallback

use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.

the class ContainerPresenter method toggleActivationContainer.

public void toggleActivationContainer() {
    if (containerSpec.getStatus().equals(KieContainerStatus.DEACTIVATED)) {
        specManagementService.call(new RemoteCallback<Void>() {

            @Override
            public void callback(final Void response) {
                refresh();
            }
        }, new ErrorCallback<Object>() {

            @Override
            public boolean error(final Object o, final Throwable throwable) {
                notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
                refresh();
                return false;
            }
        }).activateContainer(containerSpec);
    } else if (containerSpec.getStatus().equals(KieContainerStatus.STARTED)) {
        specManagementService.call(new RemoteCallback<Void>() {

            @Override
            public void callback(final Void response) {
                refresh();
            }
        }, new ErrorCallback<Object>() {

            @Override
            public boolean error(final Object o, final Throwable throwable) {
                notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
                refresh();
                return false;
            }
        }).deactivateContainer(containerSpec);
    }
}
Also used : ErrorCallback(org.jboss.errai.common.client.api.ErrorCallback) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Example 2 with ErrorCallback

use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.

the class ContainerPresenter method startContainer.

public void startContainer() {
    specManagementService.call(new RemoteCallback<Void>() {

        @Override
        public void callback(final Void response) {
            refresh();
        }
    }, new ErrorCallback<Object>() {

        @Override
        public boolean error(final Object o, final Throwable throwable) {
            notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
            refresh();
            return false;
        }
    }).startContainer(containerSpec);
}
Also used : ErrorCallback(org.jboss.errai.common.client.api.ErrorCallback) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Example 3 with ErrorCallback

use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.

the class ContainerPresenter method stopContainer.

public void stopContainer() {
    specManagementService.call(new RemoteCallback<Void>() {

        @Override
        public void callback(final Void response) {
            refresh();
        }
    }, new ErrorCallback<Object>() {

        @Override
        public boolean error(final Object o, final Throwable throwable) {
            notification.fire(new NotificationEvent(view.getStopContainerErrorMessage(), NotificationEvent.NotificationType.ERROR));
            refresh();
            return false;
        }
    }).stopContainer(containerSpec);
}
Also used : ErrorCallback(org.jboss.errai.common.client.api.ErrorCallback) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Example 4 with ErrorCallback

use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.

the class ContainerProcessConfigPresenter method save.

public void save() {
    view.disableActions();
    final ProcessConfig newProcessConfig = processConfigPresenter.buildProcessConfig();
    specManagementService.call(new RemoteCallback<Void>() {

        @Override
        public void callback(final Void containerConfig) {
            notification.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS));
            setupView(newProcessConfig);
        }
    }, new ErrorCallback<Object>() {

        @Override
        public boolean error(final Object o, final Throwable throwable) {
            notification.fire(new NotificationEvent(view.getSaveErrorMessage(), NotificationEvent.NotificationType.ERROR));
            setupView(processConfigPresenter.getProcessConfig());
            return false;
        }
    }).updateContainerConfig(processConfigPresenter.getContainerSpecKey().getServerTemplateKey().getId(), processConfigPresenter.getContainerSpecKey().getId(), Capability.PROCESS, newProcessConfig);
}
Also used : ProcessConfig(org.kie.server.controller.api.model.spec.ProcessConfig) ErrorCallback(org.jboss.errai.common.client.api.ErrorCallback) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Example 5 with ErrorCallback

use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.

the class NewServerTemplateWizard method complete.

@Override
public void complete() {
    final ServerTemplate newServerTemplate = buildServerTemplate();
    specManagementService.call(new RemoteCallback<Void>() {

        @Override
        public void callback(final Void o) {
            notification.fire(new NotificationEvent(newTemplatePresenter.getView().getNewServerTemplateWizardSaveSuccess(), NotificationEvent.NotificationType.SUCCESS));
            clear();
            NewServerTemplateWizard.super.complete();
            serverTemplateListRefreshEvent.fire(new ServerTemplateListRefresh(newServerTemplate.getId()));
        }
    }, new ErrorCallback<Object>() {

        @Override
        public boolean error(final Object o, final Throwable throwable) {
            notification.fire(new NotificationEvent(newTemplatePresenter.getView().getNewServerTemplateWizardSaveError(), NotificationEvent.NotificationType.ERROR));
            NewServerTemplateWizard.this.pageSelected(0);
            NewServerTemplateWizard.this.start();
            return false;
        }
    }).saveServerTemplate(newServerTemplate);
}
Also used : ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) ErrorCallback(org.jboss.errai.common.client.api.ErrorCallback) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) ServerTemplateListRefresh(org.kie.workbench.common.screens.server.management.client.events.ServerTemplateListRefresh) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Aggregations

ErrorCallback (org.jboss.errai.common.client.api.ErrorCallback)19 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)19 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)14 List (java.util.List)3 Dependent (javax.enterprise.context.Dependent)3 Inject (javax.inject.Inject)3 Message (org.jboss.errai.bus.client.api.messaging.Message)3 ArrayList (java.util.ArrayList)2 Optional (java.util.Optional)2 Set (java.util.Set)2 TreeSet (java.util.TreeSet)2 Collectors (java.util.stream.Collectors)2 Group (org.jboss.errai.security.shared.api.Group)2 User (org.jboss.errai.security.shared.api.identity.User)2 AssigneeType (org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType)2 AbstractEntityManager (org.uberfire.ext.security.management.api.AbstractEntityManager)2 ClientUserSystemManager (org.uberfire.ext.security.management.client.ClientUserSystemManager)2 SearchRequestImpl (org.uberfire.ext.security.management.impl.SearchRequestImpl)2 EntryCreationLiveSearchService (org.uberfire.ext.widgets.common.client.dropdown.EntryCreationLiveSearchService)2 LiveSearchCallback (org.uberfire.ext.widgets.common.client.dropdown.LiveSearchCallback)2