Search in sources :

Example 1 with WSRoutingEngineV2Status

use of com.amalto.workbench.webservices.WSRoutingEngineV2Status in project tmdm-studio-se by Talend.

the class RoutingEngineV2BrowserMainPage method startSubscriptionEngine.

private void startSubscriptionEngine() {
    try {
        WSRoutingEngineV2Status status = getServerRoutingStatus();
        TMDMService service = getMDMService();
        if (status == WSRoutingEngineV2Status.STOPPED) {
            service.routingEngineV2Action(new WSRoutingEngineV2Action(WSRoutingEngineV2ActionCode.START));
        } else if (status == WSRoutingEngineV2Status.SUSPENDED) {
            service.routingEngineV2Action(new WSRoutingEngineV2Action(WSRoutingEngineV2ActionCode.RESUME));
        }
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        if (!Util.handleConnectionException(this.getSite().getShell(), e, null)) {
            MessageDialog.openError(this.getSite().getShell(), Messages._Error, Messages.bind(Messages.RoutingEngineV2BrowserMainPage_ErrorMsg7, e.getLocalizedMessage()));
        }
    }
}
Also used : TMDMService(com.amalto.workbench.webservices.TMDMService) WSRoutingEngineV2Action(com.amalto.workbench.webservices.WSRoutingEngineV2Action) WSRoutingEngineV2Status(com.amalto.workbench.webservices.WSRoutingEngineV2Status) XtentisException(com.amalto.workbench.utils.XtentisException) ParseException(java.text.ParseException)

Example 2 with WSRoutingEngineV2Status

use of com.amalto.workbench.webservices.WSRoutingEngineV2Status in project tmdm-studio-se by Talend.

the class RoutingEngineV2BrowserMainPage method updateButtons.

protected void updateButtons() {
    try {
        WSRoutingEngineV2Status status = getServerRoutingStatus();
        startButton.setEnabled(status != WSRoutingEngineV2Status.RUNNING);
        suspendButton.setEnabled(status != WSRoutingEngineV2Status.SUSPENDED);
        stopButton.setEnabled(status != WSRoutingEngineV2Status.STOPPED);
        statusLabel.setText(status.value());
    } catch (XtentisException e) {
        startButton.setEnabled(true);
        suspendButton.setEnabled(false);
        stopButton.setEnabled(false);
        // $NON-NLS-1$
        statusLabel.setText("FAILED");
        log.debug(e.getMessage(), e);
    }
}
Also used : WSRoutingEngineV2Status(com.amalto.workbench.webservices.WSRoutingEngineV2Status) XtentisException(com.amalto.workbench.utils.XtentisException)

Example 3 with WSRoutingEngineV2Status

use of com.amalto.workbench.webservices.WSRoutingEngineV2Status in project tmdm-studio-se by Talend.

the class RoutingEngineV2BrowserMainPage method getServerRoutingStatus.

protected WSRoutingEngineV2Status getServerRoutingStatus() throws XtentisException {
    TMDMService service = getMDMService();
    WSRoutingEngineV2Status status = service.routingEngineV2Action(new WSRoutingEngineV2Action(WSRoutingEngineV2ActionCode.STATUS));
    return status;
}
Also used : TMDMService(com.amalto.workbench.webservices.TMDMService) WSRoutingEngineV2Action(com.amalto.workbench.webservices.WSRoutingEngineV2Action) WSRoutingEngineV2Status(com.amalto.workbench.webservices.WSRoutingEngineV2Status)

Example 4 with WSRoutingEngineV2Status

use of com.amalto.workbench.webservices.WSRoutingEngineV2Status in project tmdm-studio-se by Talend.

the class RoutingEngineV2BrowserMainPage method refreshData.

// createCharacteristicsContent
@Override
protected void refreshData() {
    try {
        WSRoutingEngineV2Status status = getServerRoutingStatus();
        statusLabel.setText(status.value());
        idText.setFocus();
    } catch (Exception e) {
        updateButtons();
        log.error(e.getMessage(), e);
        if (!Util.handleConnectionException(this.getSite().getShell(), e, Messages.RoutingEngineV2BrowserMainPage_ErrorRefreshingPage)) {
            MessageDialog.openError(this.getSite().getShell(), Messages.RoutingEngineV2BrowserMainPage_ErrorRefreshingPage, Messages.bind(Messages.RoutingEngineV2BrowserMainPage_ErrorRefreshingPageXX, e.getLocalizedMessage()));
        }
    }
}
Also used : WSRoutingEngineV2Status(com.amalto.workbench.webservices.WSRoutingEngineV2Status) XtentisException(com.amalto.workbench.utils.XtentisException) ParseException(java.text.ParseException)

Aggregations

WSRoutingEngineV2Status (com.amalto.workbench.webservices.WSRoutingEngineV2Status)4 XtentisException (com.amalto.workbench.utils.XtentisException)3 TMDMService (com.amalto.workbench.webservices.TMDMService)2 WSRoutingEngineV2Action (com.amalto.workbench.webservices.WSRoutingEngineV2Action)2 ParseException (java.text.ParseException)2