Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry DevtoolsUtil isEnvVarSetupForRemoteClient

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry DevtoolsUtil isEnvVarSetupForRemoteClient

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry DevtoolsUtil isEnvVarSetupForRemoteClient.

Prototype

public static boolean isEnvVarSetupForRemoteClient(Map<String, String> envVars, String secret) 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.cloudfoundry.CloudAppDashElement.java

protected void doRestartWithRemoteClient(RunState runningOrDebugging, UserInteractions ui,
        CancelationToken cancelationToken, IProgressMonitor monitor) throws Exception {

    CloudFoundryBootDashModel model = getCloudModel();
    Map<String, String> envVars = model.getRunTarget().getClient().getApplicationEnvironment(getName());

    if (getProject() == null) {
        ExceptionUtil.coreException(new Status(IStatus.ERROR, BootDashActivator.PLUGIN_ID,
                "Local project not associated to CF app '" + getName() + "'"));
    }/* www.j  a va 2 s .c  o  m*/

    new SetHealthCheckOperation(this, HealthChecks.HC_NONE, ui, /* confirmChange */true, cancelationToken)
            .run(monitor);

    if (!DevtoolsUtil.isEnvVarSetupForRemoteClient(envVars, DevtoolsUtil.getSecret(getProject()))) {
        // Let the push and debug operation resolve default properties
        CloudApplicationDeploymentProperties deploymentProperties = null;

        pushAndDebug(deploymentProperties, runningOrDebugging, ui, cancelationToken, monitor);
        /*
         * Restart and push op resets console anyway, no need to reset it
         * again
         */
    } else if (getRunState() == RunState.INACTIVE) {
        restartOnly(ui, cancelationToken, monitor);
    }

    new RemoteDevClientStartOperation(model, getName(), runningOrDebugging, cancelationToken).run(monitor);
}