Author: adietish
Date: 2011-09-09 11:18:47 -0400 (Fri, 09 Sep 2011)
New Revision: 34605
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java
Log:
[JBIDE-9510] implementing create domain (create domain test now passes!)
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java 2011-09-09
14:16:21 UTC (rev 34604)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java 2011-09-09
15:18:47 UTC (rev 34605)
@@ -22,6 +22,15 @@
*/
public class SSHKey {
+ /**
+ * the length of the key that is created when using #create. ssh-keygen uses
+ * a default of 2048
+ *
+ * @see #create(String, String, String)
+ * @see
http://en.wikipedia.org/wiki/Ssh-keygen
+ */
+ private static final int KEYLENGTH = 2048;
+
private KeyPair keyPair;
private String privateKeyPath;
private String publicKeyPath;
@@ -49,7 +58,7 @@
public static SSHKey create(String passPhrase, String privateKeyPath, String
publicKeyPath)
throws OpenshiftException {
try {
- KeyPair keyPair = KeyPair.genKeyPair(new JSch(), KeyPair.RSA);
+ KeyPair keyPair = KeyPair.genKeyPair(new JSch(), KeyPair.RSA, KEYLENGTH);
keyPair.setPassphrase(passPhrase);
keyPair.writePublicKey(publicKeyPath, "created by " +
OpenshiftCoreActivator.PLUGIN_ID);
keyPair.writePrivateKey(privateKeyPath);
@@ -62,8 +71,10 @@
/**
* Loads existing private and public ssh key from the given paths.
*
- * @param privateKeyPath the path to the private key
- * @param publicKeyPath the path to the public key
+ * @param privateKeyPath
+ * the path to the private key
+ * @param publicKeyPath
+ * the path to the public key
* @return
* @throws OpenshiftException
*/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java 2011-09-09
14:16:21 UTC (rev 34604)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java 2011-09-09
15:18:47 UTC (rev 34605)
@@ -33,7 +33,7 @@
}
protected void setStringProperty(String propertyName, Object value, ModelNode node) {
- if (isSet(value)) {
+ if (!isSet(value)) {
if (value instanceof String) {
setStringProperty((String) value, propertyName, node);
}
@@ -41,7 +41,7 @@
}
protected void setStringProperty(String propertyName, String value, ModelNode node) {
- if (isSet(value)) {
+ if (!isSet(value)) {
return;
}