From 6702a5ae441740c4c14e1cac8da0c040c11e4cac Mon Sep 17 00:00:00 2001
From: ahmadsebak
Date: Fri, 5 Jun 2015 04:56:29 -0400
Subject: [PATCH 1/4] improved ssh validation check
---
.../EmbeddedLinuxJVMBundle.properties | 5 +-
.../protocol/ssh/SSHConnectionValidator.java | 15 ++---
.../EmbeddedLinuxJVMRunConfiguration.java | 4 +-
...ditor.form => RunConfigurationEditor.form} | 26 ++++++---
...ditor.java => RunConfigurationEditor.java} | 57 ++++++++++++-------
5 files changed, 67 insertions(+), 40 deletions(-)
rename src/com/atsebak/embeddedlinuxjvm/ui/{RaspberryPIRunConfigurationEditor.form => RunConfigurationEditor.form} (89%)
rename src/com/atsebak/embeddedlinuxjvm/ui/{RaspberryPIRunConfigurationEditor.java => RunConfigurationEditor.java} (72%)
diff --git a/src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.properties b/src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.properties
index 9b1cb6f..f150594 100644
--- a/src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.properties
+++ b/src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.properties
@@ -15,15 +15,18 @@ pi.deployment.finished=Finished Deploying Java Application On The Embedded Targe
pi.deployment.build=>>>>>>>>> You're Building on Embedded Linux <<<<<<<<
pi.deployment.command=Executing Command \:
pi.ssh.connection.error=SSH Connection Error
-pi.ssh.remote.error=Could not connect to remote target
pi.packagename=Base Package
pi.connection.notsetup=Click on the run configuration settings to setup the remote connection for the raspberry pi.
pi.connection.required=Remote Connection Not Setup Yet.
pi.runner.name=Run Raspberry PI
pi.validationconection=Validate Connection
ssh.connection.success=Connection Success
+ssh.remote.error=Could not connect to remote target
pi.connection.success.title=Remote Connection Made
pi.upload=Uploading\n\r
pi.deploy=Deploying to remote target
pi.closingsession=Terminating Debug Session on Remote Target
pi.validatingconnection=Validating SSH Connection
+ssh.tryingtoconnect=Trying to contact remote target...
+app.vmoptions=VM Options
+app.programargs=Program Arguments
diff --git a/src/com/atsebak/embeddedlinuxjvm/protocol/ssh/SSHConnectionValidator.java b/src/com/atsebak/embeddedlinuxjvm/protocol/ssh/SSHConnectionValidator.java
index d0866b3..9b936a2 100644
--- a/src/com/atsebak/embeddedlinuxjvm/protocol/ssh/SSHConnectionValidator.java
+++ b/src/com/atsebak/embeddedlinuxjvm/protocol/ssh/SSHConnectionValidator.java
@@ -1,8 +1,6 @@
package com.atsebak.embeddedlinuxjvm.protocol.ssh;
-import com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.Messages;
import lombok.Builder;
import net.schmizz.sshj.SSHClient;
import org.jetbrains.annotations.NotNull;
@@ -29,21 +27,20 @@ public boolean canConnectToHostname(int timeout) {
}
}
+
/**
- * See if user can connect to remote target
- *
+ * Can connect to remote target
* @param client
* @param project
- * @throws IOException
+ * @return status
*/
- public void checkSSHConnection(SSHClient client, @NotNull Project project) throws IOException {
+ public boolean checkSSHConnection(SSHClient client, @NotNull Project project) {
try {
client.connect(ip);
client.authPassword(username, password);
- Messages.showInfoMessage(project, EmbeddedLinuxJVMBundle.getString("ssh.connection.success"), EmbeddedLinuxJVMBundle.getString("pi.connection.success.title"));
+ return true;
} catch (Exception e) {
- Messages.showErrorDialog(project, EmbeddedLinuxJVMBundle.getString("pi.ssh.remote.error"),
- EmbeddedLinuxJVMBundle.getString("pi.ssh.connection.error"));
+ return false;
}
}
diff --git a/src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java b/src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
index 862f82d..3b74dc4 100644
--- a/src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
+++ b/src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
@@ -3,7 +3,7 @@
import com.atsebak.embeddedlinuxjvm.commandline.AppCommandLineState;
import com.atsebak.embeddedlinuxjvm.runner.data.EmbeddedLinuxJVMRunConfigurationRunnerParameters;
import com.atsebak.embeddedlinuxjvm.runner.data.EmbeddedLinuxJVMRunnerValidator;
-import com.atsebak.embeddedlinuxjvm.ui.RaspberryPIRunConfigurationEditor;
+import com.atsebak.embeddedlinuxjvm.ui.RunConfigurationEditor;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.Executor;
import com.intellij.execution.configurations.*;
@@ -37,7 +37,7 @@ protected EmbeddedLinuxJVMRunConfiguration(final Project project, final Configur
@NotNull
@Override
public SettingsEditor extends RunConfiguration> getConfigurationEditor() {
- return new RaspberryPIRunConfigurationEditor(getProject());
+ return new RunConfigurationEditor(getProject());
}
/**
diff --git a/src/com/atsebak/embeddedlinuxjvm/ui/RaspberryPIRunConfigurationEditor.form b/src/com/atsebak/embeddedlinuxjvm/ui/RunConfigurationEditor.form
similarity index 89%
rename from src/com/atsebak/embeddedlinuxjvm/ui/RaspberryPIRunConfigurationEditor.form
rename to src/com/atsebak/embeddedlinuxjvm/ui/RunConfigurationEditor.form
index e9c2ee2..1221755 100644
--- a/src/com/atsebak/embeddedlinuxjvm/ui/RaspberryPIRunConfigurationEditor.form
+++ b/src/com/atsebak/embeddedlinuxjvm/ui/RunConfigurationEditor.form
@@ -1,5 +1,5 @@
-
+ Java Debugger for Embedded Systems that run on Embedded Linux
]]>
Version 0.40
+
+ -
+ Fixed the way java process gets terminated on remote target.
+
+
Version 0.35
-
From 6c32b2973fb640c2312ba06a5af7567005c845d3 Mon Sep 17 00:00:00 2001
From: ahmadsebak
Date: Tue, 9 Jun 2015 00:24:36 -0400
Subject: [PATCH 4/4] more release notes
---
META-INF/plugin.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/META-INF/plugin.xml b/META-INF/plugin.xml
index 092f670..cf45c77 100644
--- a/META-INF/plugin.xml
+++ b/META-INF/plugin.xml
@@ -14,6 +14,9 @@
-
Fixed the way java process gets terminated on remote target.
+ -
+ Better Check for SSH Connection
+
Version 0.35