Author: rob.stryker(a)jboss.com
Date: 2011-01-31 16:28:14 -0500 (Mon, 31 Jan 2011)
New Revision: 28791
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
Log:
JBIDE-8262 to branch
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-01-31
21:24:50 UTC (rev 28790)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-01-31
21:28:14 UTC (rev 28791)
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
@@ -28,11 +29,14 @@
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.IConnectorService;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PartInitException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.integration.DeltaCloudIntegrationPlugin;
import org.jboss.tools.deltacloud.integration.Messages;
+import org.jboss.tools.deltacloud.integration.wizard.CreateServerFromRSEJob;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
/**
@@ -84,7 +88,7 @@
Assert.isLegal(systemRegistry != null, "Cannot create Host: system registry is not
defined");
IHost host = systemRegistry.createHost(systemType, connectionName, hostname, null);
- host.setDefaultUserId("root"); //$NON-NLS-1$
+ host.setDefaultUserId("jboss"); //$NON-NLS-1$
return host;
}
@@ -96,6 +100,10 @@
return services[0];
}
+ public static void verifySystemConnected(IRemoteFileSubSystem system) {
+ CreateServerFromRSEJob.verifySystemConnected(system);
+ }
+
public static IStatus connect(IConnectorService service, IProgressMonitor monitor)
throws Exception {
monitor.worked(1);
service.connect(monitor);
@@ -187,4 +195,9 @@
}
});
}
+
+ public static IRemoteFileSubSystem findRemoteFileSubSystem(IHost host) {
+ return CreateServerFromRSEJob.findRemoteFileSubSystem(host);
+ }
+
}
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java 2011-01-31
21:24:50 UTC (rev 28790)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java 2011-01-31
21:28:14 UTC (rev 28791)
@@ -12,14 +12,17 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.osgi.util.NLS;
import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.subsystems.IConnectorService;
+import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.internal.progress.ProgressManagerUtil;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.job.AbstractInstanceJob;
import org.jboss.tools.deltacloud.integration.Messages;
@@ -59,6 +62,7 @@
monitor.worked(10);
SubProgressMonitor submon = new SubProgressMonitor(monitor, 90);
+ initialConnect(host);
RSEUtils.connect(RSEUtils.getConnectorService(host), 90000, submon);
} catch (Exception e) {
return ErrorUtils.handleError(Messages.ERROR,
@@ -68,6 +72,16 @@
}
return Status.OK_STATUS;
}
+
+ private void initialConnect(IHost host) {
+ try {
+ IRemoteFileSubSystem system = RSEUtils.findRemoteFileSubSystem(host);
+ system.connect(new NullProgressMonitor(), true);
+ } catch(Exception e) {
+ // ignore, expected, the server probably isn't up yet.
+ }
+ }
+
private boolean isAutoconnect() {
Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
boolean autoConnect =
prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true);
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2011-01-31
21:24:50 UTC (rev 28790)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2011-01-31
21:28:14 UTC (rev 28791)
@@ -104,7 +104,8 @@
return server;
}
- protected IRemoteFileSubSystem findRemoteFileSubSystem() {
+ // TODO move to util class
+ public static IRemoteFileSubSystem findRemoteFileSubSystem(IHost host) {
if (host == null) {
return null;
}
@@ -116,8 +117,11 @@
}
return null;
}
-
- protected void verifySystemConnected(IRemoteFileSubSystem system) {
+ protected IRemoteFileSubSystem findRemoteFileSubSystem() {
+ return findRemoteFileSubSystem(host);
+ }
+ // TODO move to utility class
+ public static void verifySystemConnected(IRemoteFileSubSystem system) {
if (!system.isConnected()) {
try {
system.connect(new NullProgressMonitor(), false);
Show replies by date