use of org.jboss.tools.openshift.cdk.server.core.internal.adapter.CDK3Server in project jbosstools-openshift by jbosstools.
the class CDKActionProvider method isCDKInitialized.
private boolean isCDKInitialized(IServer server) {
CDK3Server cdk3 = (CDK3Server) server.loadAdapter(CDK3Server.class, new NullProgressMonitor());
if (cdk3 != null) {
String home = cdk3.getMinishiftHome();
File homeF = new File(home);
if (homeF.exists() && homeF.isDirectory()) {
File cdk = new File(homeF, "cdk");
File config = new File(homeF, "config");
File cache = new File(homeF, "cache");
File configJSON = new File(config, "config.json");
if (cdk.exists() && config.exists() && cache.exists() && configJSON.exists()) {
return true;
}
}
}
return false;
}
use of org.jboss.tools.openshift.cdk.server.core.internal.adapter.CDK3Server in project jbosstools-openshift by jbosstools.
the class CDK3ShutdownController method stop.
@Override
public void stop(boolean force) {
getBehavior().setServerStopping();
CDK3Server cdk3 = (CDK3Server) getServer().loadAdapter(CDK3Server.class, new NullProgressMonitor());
String msHome = cdk3.getMinishiftHome();
if (!(new File(msHome).exists())) {
// The minishift home doesn't exist. We need to mark server as stopped and log an error
String msg = "The minishift-home for server \"" + getServer().getName() + "\" does not exist: " + msHome + "\n\nPlease make sure that the virtual machine associated with this server has been properly shutdown.";
IStatus err = new Status(IStatus.ERROR, CDKCoreActivator.PLUGIN_ID, msg, new Exception(msg));
CDKCoreActivator.pluginLog().logStatus(err);
getBehavior().setServerStopped();
return;
}
pollState();
if (getServer().getServerState() == IServer.STATE_STOPPED) {
return;
}
issueShutdownCommand();
}
Aggregations